scanspec.plot#

plot_spec to visualize a scan.

Members

plot_spec

Plot a spec, drawing the path taken through the scan.

scanspec.plot.plot_spec(spec: Spec[Any], title: str | None = None)[source]#

Plot a spec, drawing the path taken through the scan.

Uses a different colour for each frame, grey for the turnarounds, and marks the midpoints with a filled circle if there are less than 200 of them. If the scan is 2D then 2D regions are shown in black.

# Example Spec

from scanspec.plot import plot_spec
from scanspec.specs import Line
from scanspec.regions import Circle

cube = Line("z", 1, 3, 3) * Line("y", 1, 3, 10) * ~Line("x", 0, 2, 10)
spec = cube & Circle("x", "y", 1, 2, 0.9)
plot_spec(spec)

(Source code, png, hires.png, pdf)

../_images/scanspec-plot-1.png