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 at 0x4309140c>, cumulative=False, cumulative_number_of_colors=20, xaxis_frequency=False)[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 of ints) percentiles to show if plotting of percentiles is selected.
  • show_noise_models (bool, optional) Enable/disable plotting of noise models.
  • 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 of 2 floats, 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.