viz#
Draw signals, spectra, and figures in the app's plots.
plot puts a signal or spectrum on the main plot; annotate
overlays a reference curve without replacing the data; show_figure
displays a complete chart you built yourself. The rest control axes and clear
what's on screen.
annotate
#
annotate(
data: Signal1D
| Spectrum1D
| Figure
| ndarray
| list[float]
| list[int]
| tuple[ndarray, ndarray]
| tuple[list[float], list[float]],
title: str | None = None,
kind: Literal["signal", "spectrum", "auto"] = "auto",
id: str | None = None,
) -> None
Overlay a reference curve on the plot without replacing the data.
Like plot, but the curve is drawn as an annotation: it is not
saved as the current signal/spectrum and does not clear existing curves.
Good for reference lines, fits, or overlays shown alongside the data.
A charts.Figure is also accepted: its series are overlaid on the
current plot (keeping the existing layout). Like plot, the overlay is
transient — the next normal signal/spectrum push reverts the plot.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
Signal1D | Spectrum1D | Figure | ndarray | list[float] | list[int] | tuple[ndarray, ndarray] | tuple[list[float], list[float]]
|
The data to overlay — a signal/spectrum, a y-array, an
|
required |
title
|
str | None
|
Label for the overlay. |
None
|
kind
|
Literal['signal', 'spectrum', 'auto']
|
How to treat the data — |
'auto'
|
id
|
str | None
|
Target a specific plot on a custom page; leave |
None
|
clear_annotations
#
Remove overlay annotations (added with annotate).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scope
|
Literal['all', 'signal', 'spectrum']
|
Which to clear — |
required |
plot
#
plot(
data: Signal1D
| Spectrum1D
| Figure
| ndarray
| list[float]
| list[int]
| tuple[ndarray, ndarray]
| tuple[list[float], list[float]],
kind: Literal["signal", "spectrum", "auto"] = "auto",
title: str | None = None,
save_to_state: bool = True,
clear: bool = True,
id: str | None = None,
) -> None
Draw a signal, spectrum, or custom charts figure on the plot.
Accepts a Signal/Spectrum object, a single array (plotted against
its index), an (x, y) pair, or a charts.Figure — which is rendered
with its full layout natively on the plot (replacing whatever is there).
The figure is transient: the next normal plot/annotate of a
signal or spectrum reverts the plot to the standard layout.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
Signal1D | Spectrum1D | Figure | ndarray | list[float] | list[int] | tuple[ndarray, ndarray] | tuple[list[float], list[float]]
|
The data to plot — a signal/spectrum, a y-array, an |
required |
kind
|
Literal['signal', 'spectrum', 'auto']
|
How to treat the data — |
'auto'
|
title
|
str | None
|
Label for the plotted curve. |
None
|
save_to_state
|
bool
|
Also store the data as the current signal/spectrum
(so other tools can use it). Ignored for a |
True
|
clear
|
bool
|
Remove existing curves before drawing this one. |
True
|
id
|
str | None
|
Target a specific plot on a custom page; leave |
None
|
set_axes
#
Switch the plot axes between linear and logarithmic scaling.
Applies to both the signal and spectrum plots.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Literal['linear', 'log']
|
X-axis scale — |
'linear'
|
y
|
Literal['linear', 'log']
|
Y-axis scale — |
'linear'
|
show_figure
#
show_figure(
figure: Figure
| Figure
| ndarray
| bytes
| bytearray
| str,
id: str | None = None,
title: str | None = None,
dpi: int = 150,
width: int | None = None,
height: int | None = None,
) -> None
Display a complete figure (chart/image) in the analysis panel.
Renders the figure to an image and shows it in the Multi-Scan Analysis
figures panel. Calling again with the same id replaces the previous
figure in place — handy for live updates.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
figure
|
Figure | Figure | ndarray | bytes | bytearray | str
|
The figure to show — a |
required |
id
|
str | None
|
Reuse the same value to update a figure in place; defaults to the
title (or |
None
|
title
|
str | None
|
Caption shown above the figure. |
None
|
dpi
|
int
|
Output resolution in dots per inch. |
150
|
width
|
int | None
|
Optional width in pixels. |
None
|
height
|
int | None
|
Optional height in pixels. |
None
|
show_table
#
show_table(
data: Any
| Mapping[str, Sequence[Any]]
| tuple[Sequence[str], Sequence[Sequence[Any]]]
| Sequence[Sequence[Any]],
id: str | None = None,
title: str | None = None,
caption: str | None = None,
) -> None
Display a simple table in the analysis panel, alongside figures.
Useful when you want to inspect metrics without (or together with) charts.
Calling again with the same id replaces the previous table in place.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
Any | Mapping[str, Sequence[Any]] | tuple[Sequence[str], Sequence[Sequence[Any]]] | Sequence[Sequence[Any]]
|
The table — a pandas |
required |
id
|
str | None
|
Reuse the same value to update a table in place; defaults to the
title (or |
None
|
title
|
str | None
|
Caption shown above the table. |
None
|
caption
|
str | None
|
Optional secondary caption. |
None
|