Skip to content

Plotting

plot_dos(result: DOSResult, *, ef: float = 0.0, components: list[int] | None = None, system_total: bool = True, spin: str | None = None, orbitals: list[str] | None = None, energy_unit: str = 'Ry', figsize: tuple[float, float] = (3.4, 2.6)) -> Figure

Plot density of states curves.

Parameters:

Name Type Description Default

result

DOSResult

Parsed DOS result.

required

ef

float

Fermi energy in Ry, subtracted from the energy axis.

0.0

components

list[int] | None

Component indices to plot. Defaults to all components.

None

system_total

bool

Add the total system DOS on top of the component curves.

True

spin

str | None

Spin channel to plot — "up", "down", or None for both.

None

orbitals

list[str] | None

Which orbital DOS to include, any subset of ["s", "p", "d", "f", "total"]. Defaults to ["total"]. Pass [] to hide component curves and show only system_total.

None

energy_unit

str

"Ry" or "eV" (converts with 1 Ry = 13.6057 eV).

'Ry'

figsize

tuple[float, float]

Matplotlib figure size (width, height) in inches.

(3.4, 2.6)

Returns:

Type Description
Figure

The populated Matplotlib figure.

plot_convergence(result: GOResult, *, field: str = 'rms_error', figsize: tuple[float, float] = (3.4, 2.6)) -> Figure

Plot GO convergence history.

Parameters:

Name Type Description Default

result

GOResult

Parsed GO result.

required

field

str

Which iteration field to plot — "rms_error", "moment", "total_energy", "total_energy_ev", or "neu".

'rms_error'

figsize

tuple[float, float]

Matplotlib figure size (width, height) in inches.

(3.4, 2.6)

Returns:

Type Description
Figure

The populated Matplotlib figure.

plot_bsf(result: SPCResult, *, spin: str | None = None, ef: float = 0.0, energy_unit: str = 'Ry', cmap: str = 'YlGnBu', vmax: float | None = None, figsize: tuple[float, float] | None = None) -> Figure

Plot the Bloch spectral function (BSF) as a k-path heatmap.

Parameters:

Name Type Description Default

result

SPCResult

Parsed SPC result.

required

spin

str | None

Spin channel to plot — "up", "down", or None for both (rendered as side-by-side subplots when both channels are present).

None

ef

float

Fermi energy in Ry, subtracted from the energy axis.

0.0

energy_unit

str

"Ry" or "eV" (converts with 1 Ry = 13.6057 eV).

'Ry'

cmap

str

Matplotlib colormap name for the BSF intensity heatmap.

'YlGnBu'

vmax

float | None

Upper color-scale bound. Defaults to the 99.5th percentile of the intensity data when not given, so a few bright outlier pixels don't wash out the contrast.

None

figsize

tuple[float, float] | None

Matplotlib figure size (width, height) in inches. Defaults to (3.4, 2.6) for a single channel, or double that width when both channels are rendered side by side.

None

Returns:

Type Description
Figure

The populated Matplotlib figure. A placeholder figure is returned

Figure

(instead of raising) when the requested channel's spectral data is

Figure

unavailable or its k-path was not computed.