Skip to main content
Files added late

4 files were added to this release more than 14 days after its initial publication. Inspect the release files before installing.

QCustomPlot for PyQt5 and PyQt6

Design goals

This is Python bindings for QCustomPlot - Qt C++ library for plotting and data visualization. This binding can be complied for use with PyQ5 or PyQt6. There are myriads of Python charting libraries out there, and each may even have its reason to exist. QCustomPlot has the following goals:

  • Performance. QCustomPlot is written in modern C++ with the excellent Qt library for superior performance over alternative libraries.

  • Flexibility. QCustomPlot is one of the most customisable libraries available, with a wide range of supported graph types and full control over how the graph is rendered.

Installing

Linux

You can find compiled packages for many Linux distributions at OBS.

Windows

Install the package via our favourite package manager:

$ pip install QCustomPlot_PyQt5

or

$ pip install QCustomPlot_PyQt6

Getting started

Now let's take a look at some code:

import sys
import math
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QPen, QBrush, QColor
from PyQt5.QtWidgets import QApplication, QMainWindow
from QCustomPlot_PyQt5 import *


app = QApplication(sys.argv)
window = QMainWindow()
window.resize(800, 600)

customPlot = QCustomPlot()
window.setCentralWidget(customPlot)

graph0 = customPlot.addGraph()
graph0.setPen(QPen(Qt.blue))
graph0.setBrush(QBrush(QColor(0, 0, 255, 20)))

graph1 = customPlot.addGraph()
graph1.setPen(QPen(Qt.red))

x, y0, y1 = [], [], []
for i in range (251):
    x.append(i)
    y0.append(math.exp(-i/150.0)*math.cos(i/10.0))  # exponentially decaying cosine
    y1.append(math.exp(-i/150.0))                   # exponential envelope

graph0.setData(x, y0)
graph1.setData(x, y1)

customPlot.rescaleAxes()
customPlot.setInteraction(QCP.iRangeDrag)
customPlot.setInteraction(QCP.iRangeZoom)
customPlot.setInteraction(QCP.iSelectPlottables)

window.show()
sys.exit(app.exec_())

That's all!

Some important things:

  • QCustomPlot is a QWidget type that can be used the same way as any other widget, added to layouts, etc. However, you can nest multiple graphs in a single QCustomPlot using layouts (see the Advanced Axes demo).

Examples

Beside the examples below, you may want to check the documentation.

Supported compilers

The following compilers are known to work:

  • MSVC 140, 141
  • GCC 4.8
  • Clang 3.4

I would be happy to learn about other compilers/versions.

License

This code is licensed under the MIT License:

Copyright © 2017-2023 Dmitry Voronin, Christopher Gilbert and Sergey Salnikov

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


Part of the code is licensed under the GPL Version 3 License.


This project contains the QCustomPlot library from Emanuel Eichhammer which is licensed under the GPL Version 3 License. Copyright © 2011-2022 Emanuel Eichhammer bjoern@hoehrmann.de

Contact

If you have questions regarding the library, I would like to invite you to open an issue at Github. Please describe your request, problem, or question as detailed as possible, and also mention the version of the library you are using as well as the version of your compiler and operating system. Opening an issue at GitHub allows other users and contributors to this library to collaborate.

Thanks

I deeply appreciate the help of the following people.

  • DerManu is the official author and maintainer of the excellent QCustomPlot library.
  • dimv36 is the original author of the Python bindings for QCustomPlot 1.0.0, upon which this project is based.
  • cowo78 and cjgdev added support for the QCustomPlot 2.0.0 API.

Thanks a lot for helping out! Please let me know if I forgot someone.

Used third-party tools

This library is built, tested, documented, and whatnot using third-party tools and services. Thanks a lot!

  • SIP to generate the Python bindings.

Projects using

  • GPX Viewer --- an application for viewing GPX files as a list of points and tracks.

If you are using QCustomPlot-PyQt5 in a project and would like to share with the community, please let me know, or even better, raise a pull request.

Building from sources

Linux

Apt users (Debian, Ubuntu, etc) may follow the instructions below, users of other distributions may adapt the steps below for your own package manager. Qt5 or Qt6 can be used as a dependency.

# Fetch the necessary development tools and libraries
$ apt-get install build-essential python3-pyqt5 pyqt5-dev-tools qttools5-dev-tools

# Clone the repository and submodules
$ git clone --recursive https://github.com/salsergey/QCustomPlot-PyQt.git && cd QCustomPlot-PyQt

# Build
$ sip-build --qmake _path_to_qmake5_or_qmake6_

# Zzz..

# Install
$ sip-install --qmake _path_to_qmake5_or_qmake6_

Windows

Windows users should install Qt tools, appropriate version of VC compiler, Python, PyQt5 and SIP. You may need to build SIP from sources to ensure you have all files necessary for building other software. Then follow the instructions below to build the library, otherwise you will need to adapt the steps for your own environment.

  • Download QCustomPlot-PyQt sources from Github. You can use git or download an archive.
  • Launch Qt console and follow instructions there. It will ensure that you have all necessary tools in your PATH variable. Also be sure that python.exe binary is in your PATH.
  • Then follow these instructions:
# Go to QCustomPlot folder
cd <<PATH_TO QCustomPlot-PyQt>>

# Download submodules if you use git
git submodules update --init

# Build
sip-build --qmake _path_to_qmake5_or_qmake6_

# Zzz..

# Install
sip-install --qmake _path_to_qmake5_or_qmake6_

macOS

Users of macOS using homebrew may follow the instructions below to fetch the required packages to build the library, or simply adapt to your own environment.

# First ensure Xcode is installed, as homebrew depends on it
$ xcode-select --install

# Fetch the necessary development tools and libraries
$ brew install pyqt@5

# Clone the repository and submodules
$ git clone --recursive https://github.com/salsergey/QCustomPlot-PyQt.git && cd QCustomPlot-PyQt

# Build
$ CFLAGS='-std=c++11 -stdlib=libc++' CXXFLAGS='-std=c++11 -stdlib=libc++' sip-build --qmake _path_to_qmake5_or_qmake6_

# Zzz..

# Install
$ sip-install --qmake _path_to_qmake5_or_qmake6_

Metadata

Release files for QCustomPlot-PyQt6 2.1.1.2

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

Files added late

4 files were uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.

We recommend inspecting the release files before installing.

Source distribution (sdist)

Source distribution for QCustomPlot-PyQt6 2.1.1.2
File Size Uploaded
QCustomPlot_PyQt6-2.1.1.2.tar.gz 487.9 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for QCustomPlot-PyQt6 2.1.1.2
File
qcustomplot_pyqt6-2.1.1.2-cp314-none-win_amd64.whl CPython 3.14 none Windows x86-64 Details
qcustomplot_pyqt6-2.1.1.2-cp314-cp314-manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.28+ x86-64 Details
qcustomplot_pyqt6-2.1.1.2-cp313-none-win_amd64.whl CPython 3.13 none Windows x86-64 Details
qcustomplot_pyqt6-2.1.1.2-cp313-cp313-manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.28+ x86-64 Details
QCustomPlot_PyQt6-2.1.1.2-cp312-none-win_amd64.whl CPython 3.12 none Windows x86-64 Details
QCustomPlot_PyQt6-2.1.1.2-cp312-cp312-manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ x86-64 Details
QCustomPlot_PyQt6-2.1.1.2-cp311-none-win_amd64.whl CPython 3.11 none Windows x86-64 Details
QCustomPlot_PyQt6-2.1.1.2-cp311-cp311-manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64 Details
QCustomPlot_PyQt6-2.1.1.2-cp310-none-win_amd64.whl CPython 3.10 none Windows x86-64 Details
QCustomPlot_PyQt6-2.1.1.2-cp310-cp310-manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.28+ x86-64 Details

Total release size: 11.8 MB

Release files / QCustomPlot_PyQt6-2.1.1.2.tar.gz

Download URL QCustomPlot_PyQt6-2.1.1.2.tar.gz
Size 487.9 kB
Tags Source
SHA-256 checksum
How to use checksums
655b72d3ba573bff08ee4bebdb91ec1fe2589f7b2f00ca88dca7fda32d90e06d
BLAKE2b-256 checksum
How to use checksums
66fe3608cf235dd60cf1ccdd892786f4bb0aeb3073348ad75f04eaa36b2add6d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.8

Release files / qcustomplot_pyqt6-2.1.1.2-cp314-none-win_amd64.whl

File added late

This file was uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.

We recommend inspecting the release file before installing.

Download URL qcustomplot_pyqt6-2.1.1.2-cp314-none-win_amd64.whl
Size 852.8 kB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
dfdc8a61819fcf57d15106913ba46694e7e688f269eb30fce6ae072cef95360c
BLAKE2b-256 checksum
How to use checksums
ac00c3b2512a22a648dcf2398cdbccb1b88d678309606bc85cb90fcddd5dc4fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release files / qcustomplot_pyqt6-2.1.1.2-cp314-cp314-manylinux_2_28_x86_64.whl

File added late

This file was uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.

We recommend inspecting the release file before installing.

Download URL qcustomplot_pyqt6-2.1.1.2-cp314-cp314-manylinux_2_28_x86_64.whl
Size 1.1 MB
Tags CPython 3.14 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
c20724766fab354f406c651b39628fd2b9a2569fc5034b62a2339a2ad3ab7026
BLAKE2b-256 checksum
How to use checksums
54028ccc169464b40df38ec73f9606c8bee92a70b90f8f81c64a98640abdadf0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release files / qcustomplot_pyqt6-2.1.1.2-cp313-none-win_amd64.whl

File added late

This file was uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.

We recommend inspecting the release file before installing.

Download URL qcustomplot_pyqt6-2.1.1.2-cp313-none-win_amd64.whl
Size 2.6 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
32af2f4e428b76fa6fed1142abcae9e76cbc402faa2a119911590b34d229f0c6
BLAKE2b-256 checksum
How to use checksums
194266ea2eae39b235189e8f80846205c9fa6df0db8e7546a014124dde81241b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Release files / qcustomplot_pyqt6-2.1.1.2-cp313-cp313-manylinux_2_28_x86_64.whl

File added late

This file was uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.

We recommend inspecting the release file before installing.

Download URL qcustomplot_pyqt6-2.1.1.2-cp313-cp313-manylinux_2_28_x86_64.whl
Size 1.1 MB
Tags CPython 3.13 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
900eb99745412edf59b5a5cca05c7ec87371087db1aee46d7807cf530f9d63ae
BLAKE2b-256 checksum
How to use checksums
47f5a9413d5ee3ea367ba11aa28b7e0ce2fff0cbb4d910d78afb6343bb961310
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release files / QCustomPlot_PyQt6-2.1.1.2-cp312-none-win_amd64.whl

Download URL QCustomPlot_PyQt6-2.1.1.2-cp312-none-win_amd64.whl
Size 823.9 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
1677f69d8a787a5fa77f5e495639c76104a3729f4c1639a8f442e89cecb95e4f
BLAKE2b-256 checksum
How to use checksums
e8c3396fe90d981550d7ee52902e413fc53f5cfcf53793b0bdf7b5f3763a7440
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.3

Release files / QCustomPlot_PyQt6-2.1.1.2-cp312-cp312-manylinux_2_28_x86_64.whl

Download URL QCustomPlot_PyQt6-2.1.1.2-cp312-cp312-manylinux_2_28_x86_64.whl
Size 1.1 MB
Tags CPython 3.12 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
c761e3a05a9b9ab06d85ad266096428a2026f091615923c2fbdb86ba5f6fe754
BLAKE2b-256 checksum
How to use checksums
c4d83aac17a6f53180b194f4c9c75b6064f05c7116ecdac6a201e0f68b769e31
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.8

Release files / QCustomPlot_PyQt6-2.1.1.2-cp311-none-win_amd64.whl

Download URL QCustomPlot_PyQt6-2.1.1.2-cp311-none-win_amd64.whl
Size 823.4 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
c27e1a356074660b0c05305a32dca42d6f31accf0b14dca2b426d1cb76f97c1b
BLAKE2b-256 checksum
How to use checksums
3c4f23ee2f7ff92205d8fc7e4cc4f651f6bb0f32c90683495e522fd5ebc2b4a1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.3

Release files / QCustomPlot_PyQt6-2.1.1.2-cp311-cp311-manylinux_2_28_x86_64.whl

Download URL QCustomPlot_PyQt6-2.1.1.2-cp311-cp311-manylinux_2_28_x86_64.whl
Size 1.1 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
97131ff4ae0895f0996eac76181531f514ad311c9eb97e500fbc7e3b9224cbed
BLAKE2b-256 checksum
How to use checksums
8cec4af92628facac58293a3a030109a993f058bc20c23d44a30e51848db0979
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.8

Release files / QCustomPlot_PyQt6-2.1.1.2-cp310-none-win_amd64.whl

Download URL QCustomPlot_PyQt6-2.1.1.2-cp310-none-win_amd64.whl
Size 823.3 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
07f1c4b8f354530c88c64f3502bce465bd1a49426246f3a38f2c235a14bcc6e9
BLAKE2b-256 checksum
How to use checksums
98b9993a6d5437abfeb6eefa8f3576bec8874334ed752710f8ecb251d398e646
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.3

Release files / QCustomPlot_PyQt6-2.1.1.2-cp310-cp310-manylinux_2_28_x86_64.whl

Download URL QCustomPlot_PyQt6-2.1.1.2-cp310-cp310-manylinux_2_28_x86_64.whl
Size 1.1 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
0fc50fc777b4e7761f068bcc7f98968050312a48165a3fd5c35d3b9c049ddccc
BLAKE2b-256 checksum
How to use checksums
a76c7d3e3152b92e4dee10cb8137cd815964b287e73987c0c50634f18585fea3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.8

Release history Release notifications | RSS feed

This release

2.1.1.2 This release

11 release files

2.1.1

5 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