From 5fda6ce5962da96f1ec6dc275cfc6279dd14e86b Mon Sep 17 00:00:00 2001 From: "ashiqguntupalli@gmail.com" Date: Fri, 21 Feb 2025 22:53:19 +0100 Subject: [PATCH] =?UTF-8?q?feat:=20Add=20plot=20control=20parameters=20to?= =?UTF-8?q?=20show=20method=20in=20multi=20object=20Added=20parameters=20t?= =?UTF-8?q?o=20`multi=5Fobject.show`:=20-=20=E2=80=99show=E2=80=99:=20Togg?= =?UTF-8?q?le=20plot=20display=20(default:=20True)=20-=20`path`:=20Save=20?= =?UTF-8?q?plot=20to=20file=20(default:=20None)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/spectramap/spectramap.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/spectramap/spectramap.py b/src/spectramap/spectramap.py index a2136dc..0235ee5 100644 --- a/src/spectramap/spectramap.py +++ b/src/spectramap/spectramap.py @@ -972,14 +972,19 @@ def get_area(self, lower, upper): area = np.trapz(ranging, axis=1) return area - def show(self, tittle= 'multi', method=True): + def show(self, tittle= 'multi', method=True, path= None, show=True): plt.figure(tittle) for count in range(len(self.data)): plt.plot(self.wavenumber, self.data[count, ]) plt.xlabel('Wavenumber (cm-1)') plt.ylabel('Intensity (a.u.)') plt.title(self.name) - plt.show() + + if show: + plt.show() + + if path is not None: + plt.savefig(path) def get_data(self): return self.data.copy()