[obspy-users] Y axis limits in PPSD plots

Robert Sohn rsohn at whoi.edu
Mon Apr 27 15:54:23 CEST 2020


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

-- 
Robert Sohn
Senior Scientist
Geology and Geophysics Department
Woods Hole Oceanographic Institution

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PPSD_A00_05.2020.png
Type: image/png
Size: 43345 bytes
Desc: not available
URL: <http://lists.swapbytes.de/pipermail/obspy-users/attachments/20200427/3438ed58/attachment-0001.png>


More information about the obspy-users mailing list