[obspy-users] Y axis limits in PPSD plots

Tobias Megies megies at geophysik.uni-muenchen.de
Wed Apr 29 10:26:00 CEST 2020


So you do not want the plot limits to change, but the processing
parameters. You need to specify that when initializing your PPSD before
feeding in data:

http://docs.obspy.org/master/packages/autogen/obspy.signal.spectral_estimation.PPSD.__init__.html?highlight=db_bins

ppsd = PPSD(..., db_bins=...)

best,
Tobias


On 27/04/2020 15:54, Robert Sohn wrote:
> Thanks for the help. It's not quite working, though...
> 
> I use the following code:
> 
>         fig =
> ppsd.plot(show=False,xaxis_frequency=True,period_lim=(0.002,
> 10),cmap=pqlx,show_noise_models=False)
>         fig.axes[0].set_ylim(-140, -20)
> 
> And get, for example, the attached figure. Although I can change the
> upper y-axis limit to -20, the plot doesn't show anything above -50,
> which is the upper y-axis limit in the default settings, even though
> there is signal up there. Note that I am plotting hydrophone data, which
> is why the dB levels are not aligned with 'normal' seismometer data.
> 
> Does this have something to do with db_bin_edges setting in the ppsd
> routine?
> 
> Thanks, Rob
> 
> 
> Quoting Tobias Megies <megies at geophysik.uni-muenchen.de>:
> 
>> Use show=False, don't use filename=... and then work with the returned
>> matplotlib Figure object and call pyplot show when done or save to file.
>>
>> Something like
>> fig = ppsd.plot(...)
>> fig.axes[0].set_ylim(..., ...)
>>
>> cheers,
>> Tobias
>>
>>
>> On 24/04/2020 19:02, Robert Sohn wrote:
>>> How can I change the default y-axis limits in PPSD.plot?
>>>
>>> Thanks, Rob
>>>
>>
>> -- 
>> EMail: tobias.megies at lmu.de
>> WWW: https://www.geophysik.uni-muenchen.de
>>
>> Geophysikalisches Observatorium
>> Ludwigshöhe 8
>> 82256 Fürstenfeldbruck
>>
>> Tel: +49 (0) 89 2180-73981
>> Fax: +49 (0) 89 2180-73970
>>
>> Ludwig-Maximilians-Universität
>> Department für Geo- und Umweltwissenschaften
>> Sektion Geophysik
>> Theresienstrasse 41/IV
>> 80333 München
>>
>> Tel: +49 (0) 89 2180-4326
>> Fax: +49 (0) 89 2180-4205
>> _______________________________________________
>> obspy-users mailing list
>> obspy-users at lists.swapbytes.de
>> https://lists.swapbytes.de/mailman/listinfo/obspy-users
> 
> 
> _______________________________________________
> obspy-users mailing list
> obspy-users at lists.swapbytes.de
> https://lists.swapbytes.de/mailman/listinfo/obspy-users
> 

-- 
EMail: tobias.megies at lmu.de
WWW: https://www.geophysik.uni-muenchen.de

Geophysikalisches Observatorium
Ludwigshöhe 8
82256 Fürstenfeldbruck

Tel: +49 (0) 89 2180-73981
Fax: +49 (0) 89 2180-73970

Ludwig-Maximilians-Universität
Department für Geo- und Umweltwissenschaften
Sektion Geophysik
Theresienstrasse 41/IV
80333 München

Tel: +49 (0) 89 2180-4326
Fax: +49 (0) 89 2180-4205


More information about the obspy-users mailing list