diff --git a/CHANGELOG.txt b/CHANGELOG.txt index b7f5b17c568..404061f6c31 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -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 diff --git a/obspy/signal/spectral_estimation.py b/obspy/signal/spectral_estimation.py index 0efd6e40f1b..dd40c96e9d3 100644 --- a/obspy/signal/spectral_estimation.py +++ b/obspy/signal/spectral_estimation.py @@ -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]')