Skip to content

Commit

Permalink
PPSD: fix period_lim with xaxis_frequency=True
Browse files Browse the repository at this point in the history
  • Loading branch information
megies committed Oct 18, 2018
1 parent c3d7a79 commit 381623a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.txt
Expand Up @@ -57,6 +57,7 @@ master:
(see #2045)
* Fixed the check for new PSD slices whether they should be added or whether
they would add unwanted duplicated data (see #2229)
* Fix `period_lim` option when `xaxis_frequency=True` (see #2246)
- obspy.signal.cross_correlation:
* Add new `correlate_template()` function with 'full' normalization option,
required for correlations in template-matching
Expand Down
4 changes: 1 addition & 3 deletions obspy/signal/spectral_estimation.py
Expand Up @@ -1833,13 +1833,11 @@ def plot(self, filename=None, show_coverage=True, show_histogram=True,

ax.semilogx()
if xaxis_frequency:
xlim = map(lambda x: 1.0 / x, period_lim)
ax.set_xlabel('Frequency [Hz]')
ax.invert_xaxis()
else:
xlim = period_lim
ax.set_xlabel('Period [s]')
ax.set_xlim(sorted(xlim))
ax.set_xlim(period_lim)
ax.set_ylim(self.db_bin_edges[0], self.db_bin_edges[-1])
if self.special_handling is None:
ax.set_ylabel('Amplitude [$m^2/s^4/Hz$] [dB]')
Expand Down

0 comments on commit 381623a

Please sign in to comment.