pylbo.visualisation.spectra.spectrum_single

Classes

SingleSpectrumPlot

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

Module Contents

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[source]

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[source]

The marker used to draw the points.

Type:

markers

markersize[source]

Size of the marker.

Type:

int, float

alpha[source]

Alpha value of the points.

Type:

int, float

dataset[source]
_use_residuals[source]
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.

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.