PlotlyPublisher#
- class PlotlyPublisher(
- figure: go.Figure | go.FigureWidget | None = None,
- max_points: int = 10_000,
- flush_interval: float = 0.1,
- time_window_s: float | None = None,
Bases:
objectPlot Measurement/Command data on a Plotly figure, one trace per channel.
Requires the
plotextra (pip install "instro[plot]").Create a publisher that plots each channel on a trace named after the channel.
- Parameters:
figure
Figure to plot on. A
go.FigureWidgetupdates live in a notebook. When omitted, the publisher creates ago.FigureWidget, displays it right away, and shows it again onclose().max_points
Points kept per channel; older points drop off the plot.
flush_interval
Seconds between writes to the figure.
time_window_s
Seconds of data the x axis shows, or
None(the default) to autoscale. The window starts at the first point and scrolls forward.
Methods
Stop the flush thread, write any remaining points to the figure, and clear the buffers.
Buffer
datafor the next write to the figure.- publish(
- data: Measurement | Command,
- **kwargs,
Buffer
datafor the next write to the figure.