Live updating plot
Real-time plotting that subscribes to data streams and keeps updating: the UpdatingPlot and LivePlot containers.
Overview
quatm/GUI/entries/updating_plot.py provides the live updating plot: UpdatingPlot is a subclass of PlotItem that subscribes to data streams and periodically pulls new data to refresh the curve; LivePlot, by contrast, is a widget container that embeds an UpdatingPlot and can carry an image-stream name, which makes it convenient to embed as a dock panel in other windows.
Components
| Component | Description |
|---|---|
UpdatingPlot | Live plot item: subscribes to data streams and keeps updating the curve |
LivePlot | Widget container: embeds one UpdatingPlot and can carry an image stream |
Key methods (UpdatingPlot)
| Method | Description |
|---|---|
setnewData | Periodically pulls new data; for 1D arrays it automatically adds an x axis and then updates the curve |
updateConfiguration | Cancels the old subscriptions, resubscribes according to the stream list configured in properties and rebuilds the curves |
subscribe_window | Opens the subscription editor to select data streams and reapply the configuration |
configureWindow | Opens the property-edit dialog to adjust display settings |
Usage
from quatm.GUI.entries.updating_plot import UpdatingPlot, LivePlot
plot = UpdatingPlot(name="PMT signal") # used directly as a plot item
host = LivePlot(name="PMT signal", parent=parent) # or embedded as a container in the UI
For a more complete description, see Live plotting.