Skip to content

Commit

Permalink
use default format if unspecified
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelsoup42 committed Oct 13, 2023
1 parent c91c908 commit 1de3530
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -692,16 +692,19 @@ def plot_balance(self):
},

).get_texts():
text.set(y=text.get_window_extent().y0 + mpl.rcParams['legend.handleheight'] * text_bbox.height / 2)
text.set(y=text.get_window_extent().y0 +
mpl.rcParams['legend.handleheight'] * text_bbox.height / 2)

def get_graph_metadata(self, filename:str) -> Mapping :
"""Return graph metadata depending on file extension."""
extension=os.path.splitext(filename)[1]
if extension in (".svg",".pdf"):
save_format=os.path.splitext(filename)[1].removeprefix('.')
if not save_format:
save_format= mpl.rcParams["savefig.format"]
if save_format in ("svg","pdf"):
return { "Creator": CREATOR_STRING, "Title": self._plot_title() }
elif extension==".png":
elif save_format=="png":
return {"Software" : CREATOR_STRING,"Title": self._plot_title()}
elif extension in (".ps",".eps"):
elif save_format in ("ps","eps"):
return { "Creator": CREATOR_STRING }
else:
return {}

0 comments on commit 1de3530

Please sign in to comment.