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

ComponentDescription
DataPlotterWidgetMain plot: data source drop-down, x-axis selector and several y-axis selectors (right-click toggles the configuration panel)
YAxisWidgetHelpery-axis data chain: scaling factor, filter, binning and fitting

Key methods

MethodDescription
setDataSourceSets or changes the data source
checkForNewData / updateDatasourcesChecks for new data/new data sources and refreshes
plotDataAdds a set of x/y data to the plot area as a new curve
toggleConfigToggles the data source and y-axis configuration panels
exportpdfExports the current plot as a PDF suitable for archiving
clearClears 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