aboutsummaryrefslogtreecommitdiffstats
path: root/astro
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2017-10-28 23:05:18 +0800
committerAaron LI <aly@aaronly.me>2017-10-28 23:05:18 +0800
commit1e5f758412105f25bfbeb38423657506f6dcb0e5 (patch)
treee531a8a23a59e132a38f3e906842ac08325d02ba /astro
parentaee4cff006f19d70e52067bd262abc2ccc3c8e3f (diff)
downloadatoolbox-1e5f758412105f25bfbeb38423657506f6dcb0e5.tar.bz2
calc_psd.py: tweak plot styles
Diffstat (limited to 'astro')
-rwxr-xr-xastro/calc_psd.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/astro/calc_psd.py b/astro/calc_psd.py
index 9312614..fc7f7c0 100755
--- a/astro/calc_psd.py
+++ b/astro/calc_psd.py
@@ -180,15 +180,15 @@ class PSD:
"""
if ax is None:
fig, ax = plt.subplots(1, 1)
- #
- xmin = self.frequencies[1] / 1.2 # ignore the first 0
- xmax = self.frequencies[-1]
- ymin = np.nanmin(self.psd1d) / 10.0
- ymax = np.nanmax(self.psd1d + self.psd1d_err)
- #
- ax.errorbar(self.frequencies, self.psd1d, yerr=self.psd1d_err,
- fmt="none")
- ax.plot(self.frequencies, self.psd1d, "ko")
+
+ freqs = self.frequencies
+ xmin = freqs[1] / 1.2 # ignore the first 0
+ xmax = freqs[-1] * 1.1
+ ymin = np.min(self.psd1d) / 10.0
+ ymax = np.max(self.psd1d[1:] + self.psd1d_err[1:]) * 2
+
+ ax.errorbar(freqs, self.psd1d, yerr=self.psd1d_err, fmt="none")
+ ax.plot(freqs, self.psd1d, "ko")
ax.set_xscale("log")
ax.set_yscale("log")
ax.set_xlim(xmin, xmax)