Skip to main content

Scope like plot utilities for pyqtgraph

Project description

pyqtgraph-scope-plots

PyPI Latest Release Unit Tests

High-performance, feature-rich, and interactive oscilloscope-like plot widgets built in PyQtGraph. Designed with electrical and digital waveforms in mind, but generalizes to any timeseries data.

Example

This is primarily a widget library for those needing interactive plotting tools, but does include an example CSV viewer.

example.png

Once this package is installed, the example viewer can be started with

python -m pyqtgraph_scope_plots.csv

This starts with some default data (a sine wave, square wave, enum, and steps) but CSVs can be loaded through the interface. CSVs must have time on the first column and arbitrary data (numeric or strings) on other columns. Additional data from different CSV files can be appended, which will be interpreted as new columns.

All the features listed below are available.

Features

  • High performance using pyqtgraph, interactive navigation up to millions of points.
  • Snap-to-nearest point on hover (if zoomed in far enough).
  • Show numeric values of hovered points at the same time.
  • Select regions over time (created by double-clicking on the plot).
  • Points-of-interest, persistent markers on the plot showing numeric values (created by shift+double-clicking on the plot).
  • Statistics (min / max / average / RMS / standard deviation), over the selected region or entire data.
  • Drag-and-drop from table to plot to overlay and re-order plots.
  • Apply transformation functions, written as Python code (using simpleeval), to signals (using the right-click menu on the signals table).
  • Apply time-shift to signals (using the right-click menu on the signals table).

Architecture

This library makes heavy use of mixins to split out functionality into mostly-independent classes.

  • PlotItem Interactivity Mixins: these can be mixed in to a custom PlotItem to add interactivity:
    • SnappableHoverPlot: snaps to the data point nearest the cursor, providing a visual target. The snapped point is also available for tools to build upon.
    • LiveCursorPlot: provides a vertical line over the mouse cursor, that shows the values of all intersecting points. Uses the snapping function to snap to the nearest data point.
    • RegionPlot: provides a user-defined region (via double-click) that shows the x-axis distance between the cursors. The region data is also available for tools to build upon.
    • PointsOfInterestPlot: allows users to add arbitrarily many points of interest (vertical lines) that shows the values of all intersecting points.
    • DraggableCursorPlot: allows a programmatically-initiated draggable cursor that fires a qt-signal when moved. Used as infrastructure to support time shifting signals.
  • EnumWaveformPlot: a PlotItem that renders string-valued data as a waveform.
  • MultiPlotWidget: a QSplitter widget with multiple plots stacked vertically, with a common x-axis. These mixin classes are provided to add functionality:
    • LinkedMultiPlotWidget: links the live cursor, region, and points of interest (from interactivity mixins) between plots.
    • DroppableMultiPlotWidget: allows an externally-initiated drag-and-drop operation to reorganize (rearranging and combining / overlaying) plots.
  • SignalsTable: QTableWidget that lists signals and provides an extensible base for additional columns. These mixin classes are provided to add functionality:
    • StatsSignalsTable: adds stats (like min, max, avg) per-signal, optionally over a selected x-range.
    • DeleteableSignalsTable: adds delete-signal functionality that fires a qt-signal (and does nothing else - deletion must be handled externally).
    • TransformsSignalTable: allows the user to set a function (using a subset of Python) on signals to transform the input data. This function has access to the x (as t) and y (as x) values of the current point as well as other signals at the same index (as data).
    • TimeshiftSignalTable: allows the user to shift signals in time, in coordination with DraggableCursorPlot.
    • DraggableSignalsTable: enables initiating a drag-and-drop operation, to be dropped into some external widget.
  • PlotsTableWidget: combines MultiPlotWidget and SignalsTable (with all their mixins), linked with each other, into a QSplitter.
    • Provides an extension point for an optional widget on the bottom right through _init_controls, for example to add a controls box.
    • The data items are first initialized with _set_data_items (with name, color, and plot-type of each data item), then data can be updated with _set_data (as a name-to-(xs, ys) mapping).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyqtgraph_scope_plots-1.2.0.tar.gz (57.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyqtgraph_scope_plots-1.2.0-py3-none-any.whl (60.7 kB view details)

Uploaded Python 3

File details

Details for the file pyqtgraph_scope_plots-1.2.0.tar.gz.

File metadata

  • Download URL: pyqtgraph_scope_plots-1.2.0.tar.gz
  • Upload date:
  • Size: 57.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pyqtgraph_scope_plots-1.2.0.tar.gz
Algorithm Hash digest
SHA256 24957d9982a377cdb52a97be386c48be6f734943d23a2c20bc58469b4e5bb8cd
MD5 6628105ff0a76208cf2e07c0b9e18240
BLAKE2b-256 fde20fdcb7019aeb68d7d8eb85928d11be43ff985bd05a78912b348fe608a87e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyqtgraph_scope_plots-1.2.0.tar.gz:

Publisher: python-publish.yml on enphase/pyqtgraph-scope-plots

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyqtgraph_scope_plots-1.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pyqtgraph_scope_plots-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0f84b9372e1b3d8ef9428e251dd9d4bec7829d76e6c1d8b4b166a939b0c202a9
MD5 e118686c33faa35621f06515c7dcbae9
BLAKE2b-256 89b1fdbf687fea8c0a9b786f60b1a79fb5dc0bdd1e75b0442a26941f7f9ce32f

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyqtgraph_scope_plots-1.2.0-py3-none-any.whl:

Publisher: python-publish.yml on enphase/pyqtgraph-scope-plots

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page