PPSD.plot(filename=None, show_coverage=True, show_histogram=True, show_percentiles=False, percentiles=[0, 25, 50, 75, 100], show_noise_models=True, grid=True, show=True, max_percentage=None, period_lim=(0.01, 179), show_mode=False, show_mean=False, cmap=<matplotlib.colors.LinearSegmentedColormap object>, cumulative=False, cumulative_number_of_colors=20, xaxis_frequency=False, show_earthquakes=None)[source]

Plot the 2D histogram of the current PPSD. If a filename is specified the plot is saved to this file, otherwise a plot window is shown.


For example plots see the Obspy Gallery.

  • filename (str, optional) – Name of output file

  • show_coverage (bool, optional) – Enable/disable second axes with representation of data coverage time intervals.

  • show_percentiles (bool, optional) – Enable/disable plotting of approximated percentiles. These are calculated from the binned histogram and are not the exact percentiles.

  • show_histogram (bool, optional) – Enable/disable plotting of histogram. This can be set False e.g. to make a plot with only percentiles plotted. Defaults to True.

  • percentiles (list[int]) – percentiles to show if plotting of percentiles is selected.

  • show_noise_models (bool, optional) – Enable/disable plotting of noise models.

  • show_earthquakes (bool, optional) – Enable/disable plotting of earthquake models like in [ClintonHeaton2002] and [CauzziClinton2013]. Disabled by default (None). Specify ranges (minimum and maximum) for magnitude and distance of earthquake models given as four floats, e.g. (0, 5, 0, 99) for magnitude 1.5 - 4.5 at a epicentral distance of 10 km. Note only 10, 100 and 3000 km distances and magnitudes 1.5 to 7.5 are available. Alternatively, a distance can be specified in last float of a tuple of three, e.g. (0, 5, 10) for 10 km distance, or magnitude and distance can be specified in a tuple of two floats, e.g. (5.5, 10) for magnitude 5.5 at 10 km distance.

  • grid (bool, optional) – Enable/disable grid in histogram plot.

  • show (bool, optional) – Enable/disable immediately showing the plot. If show=False, then the matplotlib figure handle is returned.

  • max_percentage (float, optional) – Maximum percentage to adjust the colormap. The default is 30% unless cumulative=True, in which case this value is ignored.

  • period_lim (tuple(float, float), optional) – Period limits to show in histogram. When setting xaxis_frequency=True, this is expected to be frequency range in Hz.

  • show_mode (bool, optional) – Enable/disable plotting of mode psd values.

  • show_mean (bool, optional) – Enable/disable plotting of mean psd values.

  • cmap (matplotlib.colors.Colormap) – Colormap to use for the plot. To use the color map like in PQLX, [McNamara2004] use obspy.imaging.cm.pqlx.

  • cumulative (bool) – Can be set to True to show a cumulative representation of the histogram, i.e. showing color coded for each frequency/amplitude bin at what percentage in time the value is not exceeded by the data (similar to the percentile option but continuously and color coded over the whole area). max_percentage is ignored when this option is specified.

  • cumulative_number_of_colors (int) – Number of discrete color shades to use, None for a continuous colormap.

  • xaxis_frequency (bool) – If set to True, the x axis will be frequency in Hertz as opposed to the default of period in seconds.