Bindings for graphics lib QCustomPlot2 for PyQt5
|QCustomPlot2-2.0.1.tar.gz||1.22 M||2019-10-19 18:08:09||187|
|075c72ee||2019-10-19 17:46:24||Sergey Salnikov||Added bindings to protected methods to allow overloading ...|
|a2328dcf||2019-09-09 13:31:43||salsergey||Removed unnecessary dependencies in setup.py|
|71476315||2019-09-07 15:05:37||Sergey Salnikov||Updated README|
|325b08ee||2019-09-07 13:36:00||Sergey Salnikov||Improved support for different platforms and Python versi...|
|1b4d42e5||2018-12-22 05:36:30||Christopher Gilbert||Updated README.md and refactored ConvertToSubClassCode di...|
|411ebf01||2018-12-13 06:07:45||Christopher Gilbert||Fixed support for QCPErrorBars|
|917aa5f8||2018-12-13 05:06:21||Christopher Gilbert||Fixed conversion of QCustomPlot2 subtypes to Python|
|3fcc5e3d||2018-12-04 04:36:15||Christopher Gilbert||Updated README, reorganised the repository a little, and ...|
|3363a93b||2018-12-03 07:23:09||Christopher Gilbert||Added embryonic QML demo|
|e9bb2671||2018-12-01 17:55:28||Christopher Gilbert||Ported more of the QCustomPlot demos to Python|
There are myriads of Python charting libraries out there, and each may even have its reason to exist. QCustomPlot2 for PyQt5 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.
You can find compiled packages for many Linux distributions at OBS.
Install the package via our favourite package manager:
$ pip install QCustomPlot2
Now let's take a look at some code:
from PyQt5.QtGui import QPen, QBrush, QColor from QCustomPlot2 import * customPlot = QCustomPlot() 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.setInteractions(QCPInteractions(QCP.iRangeDrag | QCP.iRangeZoom | QCP.iSelectPlottable))
Some important things:
Beside the examples below, you may want to check the documentation.
The following compilers are known to work:
I would be happy to learn about other compilers/versions.
This code is licensed under the MIT License:
Copyright © 2017-2019 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.
If you have questions regarding the library, I would like to invite you to open an issue at OSDN. 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.
I deeply appreciate the help of the following people.
Thanks a lot for helping out! Please let me know if I forgot someone.
This library is built, tested, documented, and whatnot using third-party tools and services. Thanks a lot!
If you are using QCustomPlot2-PyQt5 in a project and would like to share with the community, please let me know, or even better, raise a pull request.
Apt users (Debian, Ubuntu, etc) may follow the instructions below, users of other distributions may adapt the steps below for your own package manager.
# 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/cjgdev/QCustomPlot2-PyQt5.git && cd QCustomPlot2-PyQt5 # Build $ CFLAGS=-std=c++11 CXXFLAGS=-std=c++11 python setup.py build # Zzz.. # Install $ python setup.py install
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.
# Go to QCustomPlot2 folder cd <<PATH_TO QCustomPlot2-PyQt5>> # Download submodules if you use git git submodules update --init # Build python setup.py build # Zzz.. # Install python setup.py install
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 qt --devel sip --without-python@2 pyqt --without-python@2 # Clone the repository and submodules $ git clone --recursive https://github.com/cjgdev/QCustomPlot2-PyQt5.git && cd QCustomPlot2-PyQt5 # Build $ CFLAGS='-std=c++11 -stdlib=libc++' CXXFLAGS='-std=c++11 -stdlib=libc++' python3 setup.py build # Zzz.. # Install $ python3 setup.py install
If you need to override the paths for any reason, the way to do that is by modifying setup.cfg to match your environment. You will need to add a section as below, substituting everything between
>> with the correct paths.
[build_ext] qmake = <<PATH_TO>>\qmake.exe qt-include-dir = <<QT_INCLUDE_DIR>>\include qt-library-dir = <<QT_LIBRARY_DIR>>\lib make = <<PATH_TO>>\jom.exe
|Título||Priority||Hito||Tags||Created at||Last Update|
|QCPBars crash||High||2020-11-21 04:14:49||2020-11-21 04:14:49|
|import QCustomPlot2 ImportError: DLL load failed: The specified procedure could not be found.||High||python||2020-11-04 00:19:57||2020-11-04 00:19:57|
Welcome to OSDN Wiki system. Here is your chamber Wiki space.
Check Wiki Guide (English) to refer syntax and functions.
(auto generated page)
[Permissions] view:all, edit:admins, delete/config:admins