Skip to main content

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 numpy as np
from qtpy import QtWidgets as QW

import qwt

app = QW.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), "Cosine", plot, linecolor="red", antialiased=True)
qwt.QwtPlotCurve.make(x, np.sin(x), "Sine", 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

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 PlotPy: QwtPlotZoomer, QwtCounter, QwtEventPattern, QwtPicker, QwtPlotPicker.

Only the following plot items are currently implemented in qwt (the only plot items needed by PlotPy): QwtPlotItem (base class), QwtPlotGrid, 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:

  • Drop support for PyQt4 and PySide2
  • Drop support for Python <= 3.8
  • Replace setup.py by pyproject.toml, using setuptools (e.g. see guidata)
  • Add more unit tests: the ultimate goal is to reach 90% code coverage

Dependencies and installation

Supported Qt versions and bindings

The whole PlotPyStack set of libraries relies on the Qt GUI toolkit, thanks to QtPy, an abstraction layer which allows to use the same API to interact with different Python-to-Qt bindings (PyQt5, PyQt6, PySide2, PySide6).

Compatibility table:

PythonQwt version PyQt5 PyQt6 PySide2 PySide6
0.15 and earlier ✅ ⚠️ ❌ ⚠️
Latest ✅ ✅ ❌ ✅

Requirements

  • Python >=3.9
  • QtPy >= 1.9 (and a Python-to-Qt binding library, see above)
  • NumPy >= 1.21

Optional dependencies

  • coverage, pytest (for unit tests)
  • sphinx (for documentation generation)

Installation

From PyPI:

pip install PythonQwt

From the source package:

python -m build

Performance investigation

Tooling for performance benchmarks, profiling and visual-regression checks across PyQt5/PyQt6/PySide6 lives in scripts/. See doc/issue93_optimization_summary.md for a worked example.

Copyrights

Main code base

  • Copyright © 2002 Uwe Rathmann, for the original Qwt C++ code
  • Copyright © 2015 Pierre Raybaut, for the Qwt C++ to Python translation and optimization
  • Copyright © 2015 Pierre Raybaut, for the PythonQwt specific and exclusive Python material

Some examples

  • Copyright © 2003-2009 Gerard Vermeulen, for the original PyQwt code
  • Copyright © 2015 Pierre Raybaut, for the PyQt5/PySide port and further developments (e.g. ported to PythonQwt API)

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.

Release files for PythonQwt 0.16.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for PythonQwt 0.16.3
File Size Uploaded
pythonqwt-0.16.3.tar.gz 1.2 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for PythonQwt 0.16.3
File Interpreter ABI Platform
pythonqwt-0.16.3-py3-none-any.whl Python 3 none any Details

Total release size: 2.3 MB

Release files / pythonqwt-0.16.3.tar.gz

Download URL pythonqwt-0.16.3.tar.gz
Size 1.2 MB
Tags Source
SHA-256 checksum
How to use checksums
26af515f27d548cbbf42d2773870c752bf11551476eada5a7e5ad2eb343e74cb
BLAKE2b-256 checksum
How to use checksums
c5a89db762713cb41772c18652ff0c7e0af1c77c7483b5a7ad25e4d30033303f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / pythonqwt-0.16.3-py3-none-any.whl

Download URL pythonqwt-0.16.3-py3-none-any.whl
Size 1.0 MB
Tags Python 3
SHA-256 checksum
How to use checksums
ef44e08e473d4ab004fdfd5ca9658aa2dd80266d1376bc04455932f9b51cbb86
BLAKE2b-256 checksum
How to use checksums
1626e912e3779efd7cd7f4d3a9f9c5ce6cbbcdb8035d641096e68f8980550623
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release history Release notifications | RSS feed

This release

0.16.3 This release

2 release files

0.16.2

2 release files

0.16.1

2 release files

0.15.0

2 release files

0.14.6

2 release files

0.14.5

2 release files

0.14.4

2 release files

0.14.3

2 release files

0.14.2

2 release files

0.12.5

2 release files

0.12.4

2 release files

0.12.3

2 release files

0.12.2

2 release files

0.12.1

2 release files

0.12.0

2 release files

0.11.2

2 release files

0.11.1

2 release files

0.11.0

2 release files

0.10.6

2 release files

0.10.5

2 release files

0.10.2

2 release files

0.10.0

2 release files

0.9.2

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.3

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

1 release file

0.5.5

2 release files

0.4.0

2 release files

0.3.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page