pyrocko.plot.response

This module contains functions to plot instrument response transfer functions in Bode plot style using Matplotlib.

Example

from pyrocko.plot import response
from pyrocko.example import get_example_data

get_example_data('test_response.resp')

resps, labels = response.load_response_information(
    'test_response.resp', 'resp')

response.plot(
    responses=resps, labels=labels, filename='test_response.png',
    fmin=0.001, fmax=400., dpi=75.)
../../_images/test_response.png

Example response plot

Functions

draw(response[, axes_amplitude, axes_phase, ...])

Draw instrument response in Bode plot style to given Matplotlib axes

plot(responses[, filename, dpi, fmin, fmax, ...])

Draw instrument responses in Bode plot style.

setup_axes([axes_amplitude, axes_phase])

Configure axes in Bode plot style.

draw(response, axes_amplitude=None, axes_phase=None, fmin=0.01, fmax=100.0, nf=100, normalize=False, style={}, label=None, show_breakpoints=False, color_pool=None, label_pool=None)[source]

Draw instrument response in Bode plot style to given Matplotlib axes

Parameters:
setup_axes(axes_amplitude=None, axes_phase=None)[source]

Configure axes in Bode plot style.

plot(responses, filename=None, dpi=100, fmin=0.01, fmax=100.0, nf=100, normalize=False, fontsize=10.0, figsize=None, styles=None, labels=None, show_breakpoints=False, separate_combined_labels=None)[source]

Draw instrument responses in Bode plot style.

Parameters:
  • responses – instrument responses as pyrocko.response.FrequencyResponse objects

  • fmin – minimum frequency [Hz]

  • fmax – maximum frequency [Hz]

  • nf – number of frequencies where to evaluate the response

  • normalize – if True normalize flat part of response to be 1

  • styleslist of dict objects with keyword arguments to be passed to matplotlib’s matplotlib.axes.Axes.plot() function when drawing the response lines. Length must match number of responses.

  • filename – file name to pass to matplotlib’s savefig function. If None, the plot is shown with matplotlib.pyplot.show().

  • fontsize – font size in points used in axis labels and legend

  • figsizetuple, (width, height) in inches

  • labelslist of names to show in legend. Length must correspond to number of responses.

  • show_breakpoints – show breakpoints of pole-zero responses.