pylbo.visualisation.api

Module Contents

Functions

plot_spectrum(data[, figsize, custom_figure, ...])

Plots the spectrum of a single dataset.

plot_spectrum_multi(data, xdata[, use_squared_omega, ...])

Plots the spectrum of a dataset series.

plot_merged_spectrum(data[, figsize, custom_figure, ...])

Creates a merged spectrum from various datasets, useful in plotting multiple

plot_spectrum_comparison(ds1, ds2[, figsize, ...])

Compares two spectra.

plot_equilibrium(data[, figsize, interactive])

Plots the equilibrium profiles.

plot_equilibrium_balance(data[, figsize, interactive])

Creates a plot of the balance equations.

plot_continua(data[, figsize, interactive])

Plots the continua profiles.

plot_matrices(data[, figsize])

Plots the continua profiles.

Attributes

forbidden_args

pylbo.visualisation.api.forbidden_args = ['linestyle', 'linewidth', 'lw'][source]
pylbo.visualisation.api.plot_spectrum(data, figsize=None, custom_figure=None, use_residuals=False, **kwargs)[source]

Plots the spectrum of a single dataset.

Parameters:
  • data (LegolasDataSet) – The dataset that should 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.

  • use_residuals (bool) – If True, colors the spectrum based on the residual in the datfile.

Returns:

p – The spectrum instance which can be used further to add continua, eigenfunctions, etc.

Return type:

SingleSpectrumPlot

pylbo.visualisation.api.plot_spectrum_multi(data, xdata, use_squared_omega=False, use_real_parts=True, figsize=None, custom_figure=None, **kwargs)[source]

Plots the spectrum of a dataset series.

Parameters:
  • data (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.

  • 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.

Returns:

p – The spectrum instance which can be used further to add continua, eigenfunctions, etc.

Return type:

MultiSpectrumPlot

pylbo.visualisation.api.plot_merged_spectrum(data, figsize=None, custom_figure=None, interactive=True, legend=True, **kwargs)[source]

Creates a merged spectrum from various datasets, useful in plotting multiple results from the shift-invert solver, for example. This draws every dataset in a different color by default, and creates a corresponding legend. Supply the optional argument color to draw all points in the same color.

Parameters:
  • data (LegolasDataSeries) –

  • 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.

  • interactive (bool) – If True (default), enables an interactive legend.

  • legend (bool) – If True (default), draws a legend.

Returns:

p – The spectrumfigure instance, containing the plot.

Return type:

MultiSpectrumPlot

pylbo.visualisation.api.plot_spectrum_comparison(ds1, ds2, figsize=None, custom_figure=None, lock_zoom=False, use_residuals=False, **kwargs)[source]

Compares two spectra.

Parameters:
  • ds1 (LegolasDataSet) – The first dataset, this one is put on the left panel.

  • ds2 (LegolasDataSet) – The second dataset, this one is put on the right panel.

  • figsize (tuple) – Optional figure size like the usual matplotlib (x, x) size.

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

  • lock_zoom (bool) – If True (False by default), locks the zoom of both axis. When locked, zoomin in on one of the axis automatically scales the zoom on the other one as well.

  • use_residuals (bool) – If True, colors the spectrum based on the residual in the datfile.

Returns:

p – The figure instance containing the compared spectrum plot.

Return type:

SpectrumComparisonPlot

pylbo.visualisation.api.plot_equilibrium(data, figsize=None, interactive=True, **kwargs)[source]

Plots the equilibrium profiles.

Parameters:
  • data (LegolasDataSet) – The dataset or series that should be used.

  • figsize (tuple) – Optional figure size like the usual matplotlib (x, x) size.

  • interactive (bool) – If True (default), enables an interactive legend.

Returns:

p – The profile instance containing the equilibrium plots.

Return type:

EquilibriumProfile

pylbo.visualisation.api.plot_equilibrium_balance(data, figsize=None, interactive=True, **kwargs)[source]

Creates a plot of the balance equations. These should be as close to zero as possible over the entire grid.

Parameters:
  • data (LegolasDataSet) – The dataset that should be used

  • figsize (tuple) – Optional figure size like the usual matplotlib (x, x) size.

  • interactive (bool) – If True (default), enables an interactive legend.

Returns:

p – The profile instance containing the equilibrium balance plots.

Return type:

EquilibriumBalance

pylbo.visualisation.api.plot_continua(data, figsize=None, interactive=True, **kwargs)[source]

Plots the continua profiles.

Parameters:
  • data (LegolasDataSet) – The dataset or series that should be used.

  • figsize (tuple) – Optional figure size like the usual matplotlib (x, x) size.

  • interactive (bool) – If True (default), enables an interactive legend.

Returns:

p – The profile instance containing the continua plots.

Return type:

ContinuumProfile

pylbo.visualisation.api.plot_matrices(data, figsize=None, **kwargs)[source]

Plots the continua profiles.

Parameters:
  • data (LegolasDataSet) – The dataset that should be used.

  • figsize (tuple) – Optional figure size like the usual matplotlib (x, x) size.

Returns:

p – The instance containing the matrix plots.

Return type:

MatrixFigure