Data plotter
A general-purpose measurement data plotting component: data source/multiple y axes, filtering, binning and fitting.
Overview
quatm/GUI/alignment/plotter.py provides the data plotter (DataPlotterWidget): it subscribes to
and plots data acquired during a measurement. It supports switching the data source, an x-axis
selector and multiple y-axis selectors; each y axis is processed through a configurable data chain
(scaling factor → filter → binning/fitting) before being drawn in the plot area, and the result can
be exported to PDF.
Components
| Component | Description |
|---|---|
DataPlotterWidget | Main plot: data source drop-down, x-axis selector and several y-axis selectors (right-click toggles the configuration panel) |
YAxisWidgetHelper | y-axis data chain: scaling factor, filter, binning and fitting |
Key methods
| Method | Description |
|---|---|
setDataSource | Sets or changes the data source |
checkForNewData / updateDatasources | Checks for new data/new data sources and refreshes |
plotData | Adds a set of x/y data to the plot area as a new curve |
toggleConfig | Toggles the data source and y-axis configuration panels |
exportpdf | Exports the current plot as a PDF suitable for archiving |
clear | Clears the data summary and all curves in the plot area |
Y-axis chain (YAxisWidgetHelper): updateYscale sets the scaling factor, the context menu offers
addBinning for binning and addFitting for fitting (such as Gaussian/linear), and reevaluateData
re-runs the whole data chain after a filter or similar change.
Usage
from quatm.GUI.alignment.plotter import DataPlotterWidget
plotter = DataPlotterWidget(
axis_name="myaxis",
prop_root="...",
datastream_names=[".../data"],
n_yaxis=1,
parent=parent,
)
plotter.toggleConfig() # expand the data-source / x, y axis selection config