Plotting

This submodule specializes the usual pyplot.plot function to be used as methods with Waveform objects.

GWFrames.plot.plotWaveform(this, WaveformPart='Abs', Modes=(), t_fid=None, *pyplot_args, **pyplot_kwargs)

Plot some part of the modes of a Waveform against time.

Importing GWFrames.plot attaches this function to Waveform and PNWaveform as the method plot, so that it is called as, for example,

>>> import GWFrames.plot
>>> W.plot('Abs', Modes=[[2,2], [2,-2]], c='r')

which plots the magnitudes of the (2, 2) and (2, -2) modes of W in red.

Parameters:
  • WaveformPart (str, default 'Abs') – The part of the data to plot: one of 'Abs', 'LogAbs', 'LogLogAbs', 'Arg', 'ArgUnwrapped', 'Re', or 'Im'. The Log forms use logarithmic axes.

  • Modes (int or sequence, optional) – The modes to plot, given as a single mode index, as one [ell, m] pair, or as a sequence of such pairs. If empty (the default), all modes are plotted.

  • t_fid (float, optional) – For 'ArgUnwrapped', the phases are shifted by multiples of \(2\pi\) so that they lie between 0 and \(2\pi\) at the first time step after t_fid.

  • *pyplot_args – Passed on to matplotlib.pyplot.plot (or semilogy or loglog). The legend label of each line is set to its \((\ell, m)\) automatically, unless a single line is plotted and a label is given.

  • **pyplot_kwargs – Passed on to matplotlib.pyplot.plot (or semilogy or loglog). The legend label of each line is set to its \((\ell, m)\) automatically, unless a single line is plotted and a label is given.

Returns:

list of matplotlib.lines.Line2D – The lines plotted.