Skip to main content

A Matplotlib backend for working with (Q)Threads and Qt

Project description

A Matplotlib backend for working with (Q)Threads and Qt

Features

A minimal example:

import threading
import time
import mpl_qtthread.backend
import matplotlib
import matplotlib.backends.backend_qt

mpl_qtthread.backend.initialize_qt_teleporter()
matplotlib.use("module://mpl_qtthread.backend_agg")

import matplotlib.pyplot as plt

plt.ion()


def background():
    # time.sleep(1)
    fig, ax = plt.subplots()
    (ln,) = ax.plot(range(5))
    for j in range(5):
        print(f"starting to block {j}")
        ln.set_color(f"C{j}")
        ax.set_title(f'cycle {j}')
        fig.canvas.draw_idle()
        time.sleep(5)


threading.Thread(target=background).start()
matplotlib.backends.backend_qt.qApp.exec()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mpl-qtthread-0.0.1.tar.gz (17.2 kB view details)

Uploaded Source

Built Distribution

mpl_qtthread-0.0.1-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file mpl-qtthread-0.0.1.tar.gz.

File metadata

  • Download URL: mpl-qtthread-0.0.1.tar.gz
  • Upload date:
  • Size: 17.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.11.0a4+

File hashes

Hashes for mpl-qtthread-0.0.1.tar.gz
Algorithm Hash digest
SHA256 31d73c413e06efe5a5176bcdf1b68e774c0232277d004530a79cb7907e1357e5
MD5 4ad3e3d686efbbf0f06c4f32b6b7e261
BLAKE2b-256 e023aba9a035be7f210d1c1533e1d299f7932c7ebec6b618f0c11aba4f153966

See more details on using hashes here.

File details

Details for the file mpl_qtthread-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: mpl_qtthread-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.11.0a4+

File hashes

Hashes for mpl_qtthread-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2807deb2b70ce1f46e9da454af1770ad27bc80b74b758d578a418dd78e69a70a
MD5 512fbac260ba3bdc7b223781aca90622
BLAKE2b-256 1eed42f3535df2faba03ab45057221d8dca34fc6a20df673874b8ea5c24b1f03

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page