[enhancement] adding a save option for plotting
This commit is contained in:
parent
37ed561f73
commit
14c22d73b7
@ -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,6 +435,9 @@ class PDFstatistics(object):
|
||||
if label:
|
||||
title_str += ' (' + label + ')'
|
||||
plt.title(title_str)
|
||||
if fnout:
|
||||
plt.savefig(fnout+'histplot.png')
|
||||
else:
|
||||
plt.show()
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user