From 14c22d73b7b4db931de9dc4f9e107b0515dbe938 Mon Sep 17 00:00:00 2001 From: sebastianp Date: Wed, 10 Aug 2016 10:06:34 +0200 Subject: [PATCH] [enhancement] adding a save option for plotting --- pylot/core/pick/compare.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pylot/core/pick/compare.py b/pylot/core/pick/compare.py index 3116f137..4fc8ee19 100644 --- a/pylot/core/pick/compare.py +++ b/pylot/core/pick/compare.py @@ -424,7 +424,8 @@ class PDFstatistics(object): def histplot(self, array, binlist, xlab = 'Values', - ylab = 'Frequency', title = None, label=None): + ylab = 'Frequency', title = None, label=None, + fnout = None): import matplotlib.pyplot as plt plt.hist(array,bins = binlist) plt.xlabel('Values') @@ -434,7 +435,10 @@ class PDFstatistics(object): if label: title_str += ' (' + label + ')' plt.title(title_str) - plt.show() + if fnout: + plt.savefig(fnout+'histplot.png') + else: + plt.show() def getPDFDict(self, month, evt):