Skip to content

Commit

Permalink
Merge pull request #121 from jedie/patch-2
Browse files Browse the repository at this point in the history
[MRG] Save plot when filename is specified
  • Loading branch information
vinayak-mehta committed Aug 13, 2020
2 parents a6bee88 + b741c0a commit 7054731
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion camelot/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,13 @@ def __call__(self, table, kind="text", filename=None):
)

plot_method = getattr(self, kind)
return plot_method(table)
fig = plot_method(table)

if filename is not None:
fig.savefig(filename)
return None

return fig

def text(self, table):
"""Generates a plot for all text elements present
Expand Down

0 comments on commit 7054731

Please sign in to comment.