obspy.imaging.waveform.WaveformPlotting

class WaveformPlotting(**kwargs)[source]

Bases: object

Class that provides several solutions for plotting large and small waveform data sets.

Warning

This class should NOT be used directly, instead use the plot() method of the ObsPy Stream or Trace objects.

It uses matplotlib to plot the waveforms.

Public Methods

plot

Plot the Traces showing one graph per Trace.

plot_day

Extend the seismogram.

plot_section

Plots multiple waveforms as a record section on a single plot.

plot_waveform

Creates a graph of any given ObsPy Stream object.

Private Methods

Warning

Private methods are mainly for internal/developer use and their API might change without notice.

WaveformPlotting._add_zoomlevel_warning_text()[source]
WaveformPlotting._draw_overlap_axvspan_legend()[source]
WaveformPlotting._draw_overlap_axvspans(st, ax)[source]
WaveformPlotting._plot_dayplot_scale(unit)[source]

Plots the dayplot scale if requested.

WaveformPlotting._plot_event(event)[source]

Helper function to plot an event into the dayplot.

WaveformPlotting._remove_zoomlevel_warning_text()[source]
WaveformPlotting._time_to_xvalue(t)[source]
WaveformPlotting._warn_on_xaxis_zoom(ax)[source]

Method to be used as a callback on method=fast, “minmax”-type plots to warn the user when zooming into the plot.

Special Methods

WaveformPlotting.__dayplot_get_min_max_values(*args, **kwargs)

Takes a Stream object and calculates the min and max values for each pixel in the dayplot.

Writes a three dimensional array. The first axis is the step, i.e number of trace, the second is the pixel in that step and the third contains the minimum and maximum value of the pixel.

WaveformPlotting.__dayplot_normalize_values(*args, **kwargs)

Normalizes all values in the 3 dimensional array, so that the minimum value will be 0 and the maximum value will be 1.

It will also convert all values to floats.

WaveformPlotting.__dayplot_set_x_ticks(*args, **kwargs)

Sets the xticks for the dayplot.

WaveformPlotting.__dayplot_set_y_ticks(*args, **kwargs)

Sets the yticks for the dayplot.

WaveformPlotting.__get_mergable_ids()
WaveformPlotting.__get_merge_id(tr)
WaveformPlotting.__plot_min_max(trace, ax, *args, **kwargs)

Plots the data using a min/max approach that calculated the minimum and maximum values of each “pixel” and then plots only these values. Works much faster with large data sets.

WaveformPlotting.__plot_set_x_ticks(*args, **kwargs)

Goes through all axes in pyplot and sets time ticks on the x axis.

WaveformPlotting.__plot_set_y_ticks(*args, **kwargs)
WaveformPlotting.__plot_straight(trace, ax, *args, **kwargs)

Just plots the data samples in the self.stream. Useful for smaller datasets up to around 1000000 samples (depending on the machine on which it’s being run).

Slow and high memory consumption for large datasets.

WaveformPlotting.__sect_fraction_to_offset(fraction)

Helper function to return fractions from offsets

WaveformPlotting.__sect_init_color()

Define the color of each trace

WaveformPlotting.__sect_init_plot()

Function initialises plot all the illustration is done by self.plot_section()

WaveformPlotting.__sect_init_time()

Define the time vector for each trace

WaveformPlotting.__sect_init_traces()

Arrange the trace data used for plotting.

If necessary the data is resampled before being collected in a continuous list.

WaveformPlotting.__sect_normalize_traces()

This helper function normalizes the traces

WaveformPlotting.__sect_scale_traces()

The traces have to be scaled to fit between 0-1., each trace gets distance-range/num_traces space. adjustable by scale=1.0.

WaveformPlotting.__setup_figure()

The design and look of the whole plot to be produced.

WaveformPlotting.__del__()[source]

Destructor closes the figure instance if it has been created by the class.

WaveformPlotting.__delattr__(name, /)

Implement delattr(self, name).

WaveformPlotting.__dir__()

Default dir() implementation.

WaveformPlotting.__eq__(value, /)

Return self==value.

WaveformPlotting.__format__(format_spec, /)

Default object formatter.

WaveformPlotting.__ge__(value, /)

Return self>=value.

WaveformPlotting.__getattribute__(name, /)

Return getattr(self, name).

WaveformPlotting.__gt__(value, /)

Return self>value.

WaveformPlotting.__hash__()

Return hash(self).

WaveformPlotting.__init__(**kwargs)[source]

Checks some variables and maps the kwargs to class variables.

WaveformPlotting.__init_subclass__()

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

WaveformPlotting.__le__(value, /)

Return self<=value.

WaveformPlotting.__lt__(value, /)

Return self<value.

WaveformPlotting.__ne__(value, /)

Return self!=value.

WaveformPlotting.__new__(**kwargs)
WaveformPlotting.__reduce__()

Helper for pickle.

WaveformPlotting.__reduce_ex__(protocol, /)

Helper for pickle.

WaveformPlotting.__repr__()

Return repr(self).

WaveformPlotting.__setattr__(name, value, /)

Implement setattr(self, name, value).

WaveformPlotting.__sizeof__()

Size of object in memory, in bytes.

WaveformPlotting.__str__()

Return str(self).

WaveformPlotting.__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).