Skip to main content
https://img.shields.io/pypi/v/dvg-pyqtgraph-monkeypatch https://img.shields.io/badge/License-MIT-purple.svg

DvG_PyQtGraph_Monkeypatch

Monkeypatch for pyqtgraph==0.11.0 resulting in superior OpenGL performance in contrast to more recent 0.11.1 to 0.12.3

This monkeypatch is safe to import and will only get applied when it detects the correct PyQtGraph version pyqtgraph == 0.11.0. For other versions it will not affect anything at all. Also, when not using OpenGL in experimental mode, nothing changes.

Installation:

pip install dvg-pyqtgraph-monkeypatch

Reason for monkeypatch

This patch is intended for PyQtGraph with OpenGL acceleration enabled as such:

import pyqtgraph as pg
import OpenGL.GL as gl  # pylint: disable=unused-import
pg.setConfigOptions(useOpenGL=True)
pg.setConfigOptions(enableExperimental=True)
pg.setConfigOptions(antialias=True)

Above code will enable OpenGL acceleration within PyQtGraph and adds anti-aliasing to the chart curves. However, from versions 0.11.0 to 0.12.2 it will not draw the linewidth of the curves correctly and they remain at 1 pixel width, regardless of the set linewidth. This patch fixes the linewidth issue.

Why do I fix the PyQtgraph version for this monkeypatch to 0.11.0? Several reasons:

  • 0.11.0 draws the axis tick labels at the borders of the pyqtgraph.PlotWidget nicely, without cutting them off mid-way of the label itself. From 0.11.1 and up the tick labels will be cut off when they are at the border. That can be very confusing when reading the graph.

  • The most recent version at time of writing (0.12.3) actually has fixed the linewidth issue. However, the previous problem on the tick labels still applies.

  • It appears that 0.11.0 has superior plotting performance in frames per second / CPU load in contrast to 0.12.0 and up. This was confirmed and tested in another of my projects https://github.com/Dennis-van-Gils/DvG_Arduino_lock-in_amp. There is a different method used to render the graphs in OpenGL in these more recent PyQtGraph versions.

Usage

You only have to import the module into your Python code after you have imported PyQtGraph. That’s all. The patch will then be applied automatically.

import dvg_monkeypatch_pyqtgraph  # pylint: disable=unused-import

Changelog

2.0.0 (2022-01-20)

  • Turned into a separate PyPi package with proper documentation.

1.0.0 (?)

  • First but unreleased version. Was bundled together with every separate project instead.

Metadata

Release files for dvg-pyqtgraph-monkeypatch 2.0.0

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

Source distribution (sdist)

Source distribution for dvg-pyqtgraph-monkeypatch 2.0.0
File Size Uploaded
dvg-pyqtgraph-monkeypatch-2.0.0.tar.gz 5.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dvg-pyqtgraph-monkeypatch 2.0.0
File Interpreter ABI Platform
dvg_pyqtgraph_monkeypatch-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 11.0 kB

Release files / dvg-pyqtgraph-monkeypatch-2.0.0.tar.gz

Download URL dvg-pyqtgraph-monkeypatch-2.0.0.tar.gz
Size 5.7 kB
Tags Source
SHA-256 checksum
How to use checksums
17ef89b6ccb7fc8fe76a122da7fc0e030013929db5437407d5f87c1704b63cd1
BLAKE2b-256 checksum
How to use checksums
32ee8227deb0c4011a1854aa42bcc35214433e98495ccb8d7c2794a5d4469f2c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.10

Release files / dvg_pyqtgraph_monkeypatch-2.0.0-py3-none-any.whl

Download URL dvg_pyqtgraph_monkeypatch-2.0.0-py3-none-any.whl
Size 5.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6f321c9268227c69c6ad30beabccbbdba4ec6100ae4139bc20066d41059423db
BLAKE2b-256 checksum
How to use checksums
d910fbbce17935dd417e4af73c0e60c7e00c11e3c7582579f12172f8b685edad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.10

Release history Release notifications | RSS feed

This release

2.0.0 This release

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