pylbo.visualisation.spectra.spectrum_multi
Classes
Subclass that draws the multispectra. |
Module Contents
- class pylbo.visualisation.spectra.spectrum_multi.MultiSpectrumPlot(dataseries, xdata, use_squared_omega, use_real_parts, figsize, custom_figure, **kwargs)
Bases:
pylbo.visualisation.spectra.spectrum_figure.SpectrumFigure
Subclass that draws the multispectra.
- Parameters:
dataseries (LegolasDataSeries) – The dataseries that should be used.
xdata (str, list, numpy.ndarray) – Data to use for the horizontal axis. This can either be a key from the parameters dictionary, or a list/numpy array containing actual data.
use_squared_omega (bool) – If True, this will square the eigenvalues when they are plotted on the vertical axis. If False (default), either the real or imaginary part of the eigenvalues will be plotted depending on the value of use_real_parts.
use_real_parts (bool) – If True (default), this will plot the real part of the eigenvalues on the vertical axis. If False the imaginary part will be used.
figsize (tuple) – Optional figure size like the usual matplotlib (x, x) size.
custom_figure (tuple) – Optional, in the form (fig, ax). If supplied no new figure will be created but this one will be used instead. fig refers to the matplotlib figure and ax to a (single) axes instance, meaning that you can pass a subplot as well.
- dataseries
- use_squared_omega
- _w_pow = 1
- use_real_parts
- xdata
- ydata
- x_scaling
- y_scaling
- _validate_xdata(xdata)
Validates the xdata passed, does typechecking and necessary casting. If a string is passed, this will request the proper values based on the parameters.
- Parameters:
xdata (str, list, numpy.ndarray) – The xdata used as x values on the spectrum plot.
- Returns:
xdata_values – The xdata values of proper length and casted to a Numpy array.
- Return type:
- _get_ydata()
Gets the y data based on the value of
use_squared_omega
.- Returns:
ydata – The y data values, either the real or imaginary parts based on
use_real_parts
. Every element is an array in itself corresponding to the various datasets, hence depending on the gridpoints in every dataset the elements themselves may be of different length.- Return type:
- set_x_scaling(x_scaling)
Sets the x scaling, properly adjusted to the dataseries length.
- Parameters:
x_scaling (int, float, complex, numpy.ndarray) – Values to use for the x-scaling.
- set_y_scaling(y_scaling)
Sets the y scaling, properly adjusted to the dataseries length.
- Parameters:
y_scaling (int, float, complex, numpy.ndarray) – Values to use for the y-scaling.
- add_spectrum()
Draw method, creates the spectrum.
- add_continua(interactive=True)
Adds the continua to the plot, either interactive or not.
- Parameters:
interactive (bool) – If True, makes the legend interactive.
- add_eigenfunctions()
Adds the eigenfunctions to the current figure.