From 23d802c88cba6f72d481ad5a742b124e1a6b3feb Mon Sep 17 00:00:00 2001 From: Michael Lam Date: Sat, 15 Aug 2020 02:34:50 -0400 Subject: [PATCH] plot y label to Flux Density if appropriate --- pypulse/archive.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pypulse/archive.py b/pypulse/archive.py index dd0c7f1..9ba1da5 100644 --- a/pypulse/archive.py +++ b/pypulse/archive.py @@ -1313,7 +1313,11 @@ def plot(self, ax=None, show=True): ax.plot(np.arange(len(data), dtype=np.float)/len(data), data, 'k') ax.set_xlim(0, 1) ax.set_xlabel("Pulse Phase") - ax.set_ylabel("Intensity") + unit = self.getDataUnit() + if unit == "Janksy": + ax.set_ylabel("Flux Density (%s)"%u.unitchanger(unit)) + else: + ax.set_ylabel("Intensity") #if "SCALE" in self.subintheader: # ax.set_ylabel(self.subintheader["SCALE"]) #this is still off if show: