PlotPyStack / PythonQwt

Qt plotting widgets for Python (pure Python reimplementation of Qwt C++ library)
https://pypi.org/project/PythonQwt/
Other
86 stars 25 forks source link

PythonQwt: Qt plotting widgets for Python

license pypi version PyPI status PyPI pyversions download count Documentation Status

ℹ️ Created in 2014 by Pierre Raybaut and maintained by the PlotPyStack organization.

PythonQwt Test Launcher

The PythonQwt project was initiated to solve -at least temporarily- the obsolescence issue of PyQwt (the Python-Qwt C++ bindings library) which is no longer maintained. The idea was to translate the original Qwt C++ code to Python and then to optimize some parts of the code by writing new modules based on NumPy and other libraries.

The PythonQwt package consists of a single Python package named qwt and of a few other files (examples, doc, ...).

See documentation online or PDF for more details on the library and changelog for recent history of changes.

Sample

import qwt
import numpy as np

app = qwt.qt.QtGui.QApplication([])

# Create plot widget
plot = qwt.QwtPlot("Trigonometric functions")
plot.insertLegend(qwt.QwtLegend(), qwt.QwtPlot.BottomLegend)

# Create two curves and attach them to plot
x = np.linspace(-10, 10, 500)
qwt.QwtPlotCurve.make(x, np.cos(x), "Cosinus", plot, linecolor="red", antialiased=True)
qwt.QwtPlotCurve.make(x, np.sin(x), "Sinus", plot, linecolor="blue", antialiased=True)

# Resize and show plot
plot.resize(600, 300)
plot.show()

app.exec_()

Simple plot example

Examples (tests)

The GUI-based test launcher may be executed from Python:

from qwt import tests
tests.run()

or from the command line:

PythonQwt

Tests may also be executed in unattended mode:

PythonQwt-tests --mode unattended

Overview

The qwt package is a pure Python implementation of Qwt C++ library with the following limitations.

The following Qwt classes won't be reimplemented in qwt because more powerful features already exist in guiqwt: QwtPlotZoomer, QwtCounter, QwtEventPattern, QwtPicker, QwtPlotPicker.

Only the following plot items are currently implemented in qwt (the only plot items needed by guiqwt): QwtPlotItem (base class), QwtPlotItem, QwtPlotMarker, QwtPlotSeriesItem and QwtPlotCurve.

See "Overview" section in documentation for more details on API limitations when comparing to Qwt.

Roadmap

The qwt package short-term roadmap is the following:

Dependencies

Requirements

Optional dependencies

Installation

From the source package:

python -m build

Copyrights

Main code base

PyQt, PySide and Python2/Python3 compatibility modules

Some examples

License

The qwt Python package was partly (>95%) translated from Qwt C++ library: the associated code is distributed under the terms of the LGPL license. The rest of the code was either wrote from scratch or strongly inspired from MIT licensed third-party software.

See included LICENSE file for more details about licensing terms.