From 7525d42f1fc59915d3a4c3232a14a87a9a7c2a12 Mon Sep 17 00:00:00 2001 From: xumi1993 Date: Tue, 5 Nov 2024 14:47:53 -0500 Subject: [PATCH] debug plotrt --- seispy/plotR.py | 19 +++++++++---------- seispy/plotRT.py | 19 +++++++++---------- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/seispy/plotR.py b/seispy/plotR.py index e1c7c76e..07e789a0 100644 --- a/seispy/plotR.py +++ b/seispy/plotR.py @@ -109,16 +109,15 @@ def plot(self, out_path=None, outformat='g', show=False): """ self.plot_waves() self.set_fig() - if outformat is None and not show: - return - elif outformat == 'g': - self.fig.savefig(join(out_path, self.stadata.staname+'_{}_{}order_{:.1f}.png'.format( - self.stadata.comp, self.key, self.stadata.f0[0])), - dpi=400, bbox_inches='tight') - elif outformat == 'f': - self.fig.savefig(join(out_path, self.stadata.staname+'_{}_{}order_{:.1f}.pdf'.format( - self.stadata.comp, self.key, self.stadata.f0[0])), - format='pdf', bbox_inches='tight') + if out_path is not None: + if outformat == 'g': + self.fig.savefig(join(out_path, self.stadata.staname+'_{}_{}order_{:.1f}.png'.format( + self.stadata.comp, self.key, self.stadata.f0[0])), + dpi=400, bbox_inches='tight') + elif outformat == 'f': + self.fig.savefig(join(out_path, self.stadata.staname+'_{}_{}order_{:.1f}.pdf'.format( + self.stadata.comp, self.key, self.stadata.f0[0])), + format='pdf', bbox_inches='tight') if show: plt.show() diff --git a/seispy/plotRT.py b/seispy/plotRT.py index 027926ec..232d1659 100644 --- a/seispy/plotRT.py +++ b/seispy/plotRT.py @@ -148,16 +148,15 @@ def plot(self, out_path=None, outformat='g', show=False): """ self.plot_waves() self.set_fig() - if outformat is None and not show: - return - elif outformat == 'g': - self.fig.savefig(join(out_path, self.stadata.staname+'_{}T_{}order_{:.1f}.png'.format( - self.stadata.comp, self.key, self.stadata.f0[0])), - dpi=400, bbox_inches='tight') - elif outformat == 'f': - self.fig.savefig(join(out_path, self.stadata.staname+'_{}T_{}order_{:.1f}.pdf'.format( - self.stadata.comp, self.key, self.stadata.f0[0])), - format='pdf', bbox_inches='tight') + if out_path is not None: + if outformat == 'g': + self.fig.savefig(join(out_path, self.stadata.staname+'_{}T_{}order_{:.1f}.png'.format( + self.stadata.comp, self.key, self.stadata.f0[0])), + dpi=400, bbox_inches='tight') + elif outformat == 'f': + self.fig.savefig(join(out_path, self.stadata.staname+'_{}T_{}order_{:.1f}.pdf'.format( + self.stadata.comp, self.key, self.stadata.f0[0])), + format='pdf', bbox_inches='tight') if show: plt.show()