pylbo.visualisation.spectra.spectrum_single

Module Contents

Classes

SingleSpectrumPlot

Creates a plot of a single spectrum based on a given dataset.

class pylbo.visualisation.spectra.spectrum_single.SingleSpectrumPlot(dataset, figsize, custom_figure, use_residuals, **kwargs)[source]

Bases: pylbo.visualisation.spectra.spectrum_figure.SpectrumFigure

Creates a plot of a single spectrum based on a given dataset.

Parameters:
  • dataset (LegolasDataSet) – The dataset used to create the spectrum.

  • figsize (tuple) – Figure size used when creating a window, analogous to matplotlib.

  • custom_figure (tuple) – The custom figure to use in the form (fig, axes).

  • use_residuals (bool) – If True, colors the spectrum points based on the residuals.

dataset

The dataset passed as parameter

Type:

LegolasDataSet

w_real

Real part of the eigenvalues as a numpy array.

Type:

numpy.ndarray(dtype=float, ndim=1)

w_imag

Imaginary part of the eigenvalues as a numpy array.

Type:

numpy.ndarray(dtype=float, ndim=1)

marker

The marker used to draw the points.

Type:

markers

markersize

Size of the marker.

Type:

int, float

alpha

Alpha value of the points.

Type:

int, float

add_spectrum()[source]

Adds the spectrum to the plot, makes the points pickable.

add_continua(interactive=True)[source]

Adds the continua to the spectrum.

Parameters:

interactive (bool) – If True, makes the legend pickable.

Returns:

c_handler – The legendhandler used to plot the continua.

Return type:

ContinuaHandler

add_eigenfunctions()[source]

Adds the eigenfunctions to the plot, sets the eigenfunction handler.

add_derived_eigenfunctions()[source]

Adds the derived eigenfunctions to the plot, sets the eigenfunction handler.

draw_resonances()[source]

In case the (derived) eigenfunctions are added to the plot, the locations of resonance with the continua will also be drawn. Does nothing if the (derived) eigenfunctions are not shown.

_get_colors() numpy.ndarray[source]

Returns the colors for the spectrum points.