Skip to content

Commit

Permalink
subplots with redundant xticks
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelsoup42 committed Oct 14, 2023
1 parent e483c43 commit 5358d71
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 15 deletions.
19 changes: 13 additions & 6 deletions src/cardano_account_pandas_dumper/cardano_account_pandas_dumper.py
Original file line number Diff line number Diff line change
Expand Up @@ -595,14 +595,21 @@ def _plot_title(self):

def plot_balance(self):
""" Create a Matplotlib plot with the asset balance over time."""
balance = self.make_balance_frame(with_total=False,raw_values=False).cumsum()
balance.plot(
title=self._plot_title(),
subplots=True
)
balance = self.make_balance_frame(with_total=False,raw_values=False).cumsum().replace(pd.NA,0)
fig,ax=pyplot.subplots(len(balance.columns),2,
width_ratios=(7,1),
figsize=(11.69,2.0675*len(balance.columns)))
fig.suptitle(self._plot_title())
for i in range(len((balance.columns))):
ax[i][1].axis("off")
balance.plot(
y=balance.columns[i],
ax=ax[i][0],
legend=False,
)

def get_graph_metadata(self, filename:str) -> Mapping :
"""Return graph metadata depending on file extension."""
"""Return graph metadata for file name."""
save_format=os.path.splitext(filename)[1].removeprefix('.')
if not save_format:
save_format= mpl.rcParams["savefig.format"]
Expand Down
16 changes: 7 additions & 9 deletions src/cardano_account_pandas_dumper/matplotlib.rc
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@

axes.formatter.limits: -10, 12
axes.grid: True
axes.grid.which: both
axes.titleweight: bold
axes.spines.bottom: False
axes.spines.left: True # display axis spines
axes.spines.right: False
axes.spines.top: False
figure.constrained_layout.use: True
figure.figsize: 20,40
legend.fontsize:medium
legend.frameon:False
legend.handleheight:2
legend.handlelength:2
legend.labelcolor:linecolor
legend.loc:upper left
savefig.pad_inches:0.5
figure.titleweight: bold
savefig.pad_inches:0.5

0 comments on commit 5358d71

Please sign in to comment.