From f8b6181988bf36152b731eb871bddf910f77fe86 Mon Sep 17 00:00:00 2001 From: Jens Diemer Date: Sun, 15 Mar 2020 13:20:27 +0100 Subject: [PATCH 1/2] Fix #120 - Save plot --- camelot/plotting.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/camelot/plotting.py b/camelot/plotting.py index 5e0dc0c..6d5def1 100644 --- a/camelot/plotting.py +++ b/camelot/plotting.py @@ -43,7 +43,12 @@ class PlotMethods(object): ) plot_method = getattr(self, kind) - return plot_method(table) + fig = plot_method(table) + + if filename: + fig.savefig(filename) + + return fig def text(self, table): """Generates a plot for all text elements present From b741c0a9e90740b9120c33b1216dadff1f4a3eb9 Mon Sep 17 00:00:00 2001 From: Vinayak Mehta Date: Fri, 14 Aug 2020 02:35:50 +0530 Subject: [PATCH 2/2] Check for none and return none --- camelot/plotting.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/camelot/plotting.py b/camelot/plotting.py index 6d5def1..c35854b 100644 --- a/camelot/plotting.py +++ b/camelot/plotting.py @@ -45,8 +45,9 @@ class PlotMethods(object): plot_method = getattr(self, kind) fig = plot_method(table) - if filename: + if filename is not None: fig.savefig(filename) + return None return fig