Metadata-Version: 2.1
Name: mpl-qtthread
Version: 0.0.1
Summary: A Matplotlib backend for working with (Q)Threads and Qt
Home-page: https://github.com/tacaswell/mpl-qtthread
Author: Brookhaven National Laboratory
Author-email: tcaswell@bnl.gov
License: BSD (3-clause)
Platform: UNKNOWN
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.7
License-File: LICENSE
License-File: AUTHORS.rst
Requires-Dist: matplotlib
Requires-Dist: pyqt5

============
mpl-qtthread
============

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

* Free software: 3-clause BSD license
* Documentation: (COMING SOON!) https://tacaswell.github.io/mpl-qtthread.

Features
--------

A minimal example:

.. code-block:: python


   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()


