Skip to main content

Pyside2 bindings for QCustomplot

This project provides Python (v3.6 - v3.10) bindings for the popular OpenSource QCustomPlot (v2.1.0) Qt (v5.15.2) plotting library. The bindings are provided for Linux and Windows (64bit).

The project can be found on Github.

Installation

You can install the library and run the examples with the following commands. Preferably you should do this in a python virtual environment.

pip install qcustomplot_pyside2  # Install latest version of the library
qcustomplot_examples             # Start demos with default delay
qcustomplot_examples 0           # Start demos without automatic continuation
qcustomplot_examples 5000        # Continue demos every 5000 ms

Examples

The folder qcustomplot_examples_pyside2 contains the examples from the QCustomplot C++ webpage translated to Python. These can be used as basis for own development or for seeing the features of the library.

Running all examples

The example command qcustomplot_examples linking to the script all_demos.py runs through all examples with a default or user specified delay time.

  • Install the matching python wheel from the wheels directory (preferably in a virtual environment).
  • Start the shell script 'qcustomplot_examples' which will run all examples

Simple example code

import shiboken2 as Shiboken
from PySide2 import QtGui
import sys
import math
from random import uniform,randint
from PySide2.QtWidgets import QApplication, QDialog, QLineEdit, QPushButton, QVBoxLayout,QWidget,QMainWindow
from PySide2.QtGui import QLinearGradient, QRadialGradient, QColor, QBrush, QPen, QFont, QPixmap, QPainterPath
from PySide2.QtCore import Qt, QMargins,QPointF,QObject,QCoreApplication,QFile,QTimer,QLocale,QDateTime,QDate,QSize,QTime
from PySide2.QtUiTools import QUiLoader
from qcustomplot_pyside2 import *

def demo(app):
  # Create plot
  customPlot = QCustomPlot()
  customPlot.resize(800, 600)
  customPlot.setWindowTitle('Quadratic Demo')

  # generate some data:
  x = [0.0] * 101 # initialize with entries 0..100
  y = [0.0] * 101 
  for i in range(0, 101):
    x[i] = i/50.0 - 1 # x goes from -1 to 1
    y[i] = x[i]*x[i]  # let's plot a quadratic function

  # create graph and assign data to it:
  customPlot.addGraph()
  customPlot.graph(0).setData(x, y)
  # give the axes some labels:
  customPlot.xAxis.setLabel("x")
  customPlot.yAxis.setLabel("y")
  # set axes ranges, so we see all data:
  customPlot.xAxis.setRange(-1, 1)
  customPlot.yAxis.setRange(0, 1)

  # show the plot
  customPlot.show()
  # run the main Qt loop
  res = app.exec_()
  # Make sure and manually reset pointer
  customPlot = None
  return res


if __name__ == '__main__':
  # Create the Qt Application
  app = QApplication(sys.argv)
  res = demo(app)
  sys.exit(res)

Screenshots

See the [Wiki] (https://github.com/SBGit-2019/Pyside-QCP/wiki) for some screenshots and explanations. All screenshots can also be found in the figures directory.

Versions

The version naming of the Python bindings is analogue to the naming of the QCustomPlot library.

  • v2.0.1: QCustomPlot library 2.0.1: All basic features
  • v2.1.0: QCustomPlot library 2.1.0: Experimental radial plots and more bindings.
  • v2.1.1: Small bugfixes
  • v2.1.2: Small bugfixes for Scatterplot with single points
  • v2.1.4: Bugfix for zero line and issue #4
  • v2.1.5: Allow python access to all public fields of QCP (issue #5) (Note: Access to QCP public fields has changed from methods, e.g. w.start() to fields, e.g. w.start, methods are available still as w.get_start())

License

This project is licensed under the GPLv3+ License - see the LICENSE file for details.

Additionally, you can also use these bindings / these python wheels in commercial projects:

  • if you have a commercial license for QCustomPlot 2.x
  • fullfill the Qt license requirements, which typically mean you are using only the LGPL features of Qt 5.x or have a commercial license of Qt 5.x (as the bindings link only dynamically to Qt)

Note that commercial licenses are available for [QCustomPlot] at https://www.qcustomplot.com/.

Acknowledgments

Metadata

Release files for qcustomplot-pyside2 2.1.5

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

Built distributions (wheels)

Table of built distributions (wheels) for qcustomplot-pyside2 2.1.5
File
qcustomplot_pyside2-2.1.5-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details
qcustomplot_pyside2-2.1.5-cp310-abi3-manylinux2014_x86_64.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-64 Details
qcustomplot_pyside2-2.1.5-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details
qcustomplot_pyside2-2.1.5-cp39-abi3-manylinux2014_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details
qcustomplot_pyside2-2.1.5-cp38-abi3-win_amd64.whl CPython 3.8 abi3 Windows x86-64 Details
qcustomplot_pyside2-2.1.5-cp38-abi3-manylinux2014_x86_64.whl CPython 3.8 abi3 Linux glibc 2.17+ x86-64 Details
qcustomplot_pyside2-2.1.5-cp37-abi3-win_amd64.whl CPython 3.7 abi3 Windows x86-64 Details
qcustomplot_pyside2-2.1.5-cp37-abi3-manylinux2014_x86_64.whl CPython 3.7 abi3 Linux glibc 2.17+ x86-64 Details
qcustomplot_pyside2-2.1.5-cp36-abi3-win_amd64.whl CPython 3.6 abi3 Windows x86-64 Details
qcustomplot_pyside2-2.1.5-cp36-abi3-manylinux2014_x86_64.whl CPython 3.6 abi3 Linux glibc 2.17+ x86-64 Details

Total release size: 13.8 MB

Release files / qcustomplot_pyside2-2.1.5-cp310-abi3-win_amd64.whl

Download URL qcustomplot_pyside2-2.1.5-cp310-abi3-win_amd64.whl
Size 1.1 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
5b3ed0673204febac67688135eb043ece414af9987dd94ec9964f484c43d7fec
BLAKE2b-256 checksum
How to use checksums
4579ce445438c1025f34032408afeb8029ecd18f34cc7e4fad95c2d3fb215080
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.8.10

Release files / qcustomplot_pyside2-2.1.5-cp310-abi3-manylinux2014_x86_64.whl

Download URL qcustomplot_pyside2-2.1.5-cp310-abi3-manylinux2014_x86_64.whl
Size 1.7 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
8f282ffcecf286bf4a004feaf77ef36a42300c8f0d5d7b7bccaa4798ad133956
BLAKE2b-256 checksum
How to use checksums
6b3ce7cb91b07298cc3c5b0e4357199311d1db37e27b75ec73906d0532f66179
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.8.10

Release files / qcustomplot_pyside2-2.1.5-cp39-abi3-win_amd64.whl

Download URL qcustomplot_pyside2-2.1.5-cp39-abi3-win_amd64.whl
Size 1.1 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
f6b85dc9407825ad0ce6e6d5578989ff8b52243ced32f44a29cb7200893cebe0
BLAKE2b-256 checksum
How to use checksums
a9954f920ae72f92aabc06ac62b39e12505ec0d02098512251da36bb2afa7070
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.8.10

Release files / qcustomplot_pyside2-2.1.5-cp39-abi3-manylinux2014_x86_64.whl

Download URL qcustomplot_pyside2-2.1.5-cp39-abi3-manylinux2014_x86_64.whl
Size 1.7 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
51e80b878f16cdaec33052f1562f9e1b099c66d6cb2b2223a568fb8d97e00f6a
BLAKE2b-256 checksum
How to use checksums
4c4d0ee8bf34ee9f5ca429c2e660797a1529f949a0ec6c8071ea3051aef19b6e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.8.10

Release files / qcustomplot_pyside2-2.1.5-cp38-abi3-win_amd64.whl

Download URL qcustomplot_pyside2-2.1.5-cp38-abi3-win_amd64.whl
Size 1.1 MB
Tags CPython 3.8 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
155db609f7b5711400b710526fc41a98339fc2652f85e70896bbf79a905b61a9
BLAKE2b-256 checksum
How to use checksums
e7260b1520731c73c78ce6aacc7ad3216c59bc196e62492e0ca462a4f7667643
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.8.10

Release files / qcustomplot_pyside2-2.1.5-cp38-abi3-manylinux2014_x86_64.whl

Download URL qcustomplot_pyside2-2.1.5-cp38-abi3-manylinux2014_x86_64.whl
Size 1.7 MB
Tags CPython 3.8 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
41d614d822d97c1ff5991e5273e6d4a5d9a3d2cb6ec69fafe42e8932513abc30
BLAKE2b-256 checksum
How to use checksums
8f5597e9356db766de27fc8fb7378134e5baebd0a3e021833d1aecc0099bce29
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.8.10

Release files / qcustomplot_pyside2-2.1.5-cp37-abi3-win_amd64.whl

Download URL qcustomplot_pyside2-2.1.5-cp37-abi3-win_amd64.whl
Size 1.1 MB
Tags CPython 3.7 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
cc3972e0fe4985c5c8ad43b3fb8ea795af79e3d076a40a0372821bb35dd5b7e9
BLAKE2b-256 checksum
How to use checksums
2746239354f130df49d1d67d32da11a2dd8678ae218a0e3216ca52165d921f21
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.8.10

Release files / qcustomplot_pyside2-2.1.5-cp37-abi3-manylinux2014_x86_64.whl

Download URL qcustomplot_pyside2-2.1.5-cp37-abi3-manylinux2014_x86_64.whl
Size 1.7 MB
Tags CPython 3.7 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
e1ff9efb0c141250a8d1d3c52a8b9fe6131420590e7ab5187a901dfa46c876c8
BLAKE2b-256 checksum
How to use checksums
451578f2e690200d4a5a236cc0f7d5249f3cc945144b66c22f652bce0159a264
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.8.10

Release files / qcustomplot_pyside2-2.1.5-cp36-abi3-win_amd64.whl

Download URL qcustomplot_pyside2-2.1.5-cp36-abi3-win_amd64.whl
Size 1.1 MB
Tags CPython 3.6 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
7d4c4f8c39b4b18f061153f5c0067693574c8f8db122d48a2f35eb93b1d966c9
BLAKE2b-256 checksum
How to use checksums
3a23878442b61ece7d8c7e1c7c64d3fbc018425c3e4555f75a581331de71466d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.8.10

Release files / qcustomplot_pyside2-2.1.5-cp36-abi3-manylinux2014_x86_64.whl

Download URL qcustomplot_pyside2-2.1.5-cp36-abi3-manylinux2014_x86_64.whl
Size 1.7 MB
Tags CPython 3.6 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
a5035077c3c51d20dd4b8071ed63719b1fa16d4fe6d98969b0acb744662629ae
BLAKE2b-256 checksum
How to use checksums
1de4d2c20afa6fc24ce9e638d7cf0dab0021104f06bb42c8c5c36bb1133aec75
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.8.10

Release history Release notifications | RSS feed

This release

2.1.5 This release

10 release files

2.1.2

10 release files

2.1.1

10 release files

2.1.0

10 release files

2.0.1

10 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