Skip to content

maps

fusdb.plotting.maps

2-D parameter maps: a filled field with optional iso-contours and a marker.

Reusable form of the beta utilisation vs peaking map in examples/dhe3_profile_shape_optimization.ipynb (a filled field, a fixed fusion-power iso-line, and the optimum marker).

plot_parameter_map

plot_parameter_map(x: Sequence[Sequence[float]], y: Sequence[Sequence[float]], z: Sequence[Sequence[float]], *, ax: Axes | None = None, cmap: str = 'viridis', levels: int = 20, clabel: str | None = None, iso_field: Sequence[Sequence[float]] | None = None, iso_levels: Sequence[float] | None = None, iso_label: str | None = None, marker: tuple[float, float] | None = None, marker_label: str | None = None, xlabel: str | None = None, ylabel: str | None = None, title: str | None = None) -> Axes

Filled contour of z over the (x, y) mesh.

Parameters:

Name Type Description Default
x Sequence[Sequence[float]]

2-D meshgrid array of x-coordinates.

required
y Sequence[Sequence[float]]

2-D meshgrid array of y-coordinates.

required
z Sequence[Sequence[float]]

2-D filled field aligned with x and y.

required
cmap str

Colormap for the filled field.

'viridis'
levels int

Number of filled contour levels.

20
clabel str | None

Colorbar label.

None
iso_field Sequence[Sequence[float]] | None

Optional second field drawn as iso-contours (e.g. a fixed fusion-power line over a utilisation map).

None
iso_levels Sequence[float] | None

Iso-contour levels for iso_field.

None
iso_label str | None

Optional inline label format for the iso-contours.

None
marker tuple[float, float] | None

Optional (x, y) point highlighted with a star.

None
marker_label str | None

Legend label for the marker.

None
xlabel str | None

Optional x-axis label.

None
ylabel str | None

Optional y-axis label.

None
title str | None

Optional axis title.

None

Returns:

Type Description
Axes

The axis the map was drawn on.