Skip to content

Instantly share code, notes, and snippets.

View holesond's full-sized avatar

Ondřej Holešovský holesond

View GitHub Profile
@holesond
holesond / qt_mpl_bars.py
Last active August 12, 2021 02:20
PyQt5 demo with an embedded matplotlib plot. See https://eli.thegreenplace.net/2009/01/20/matplotlib-with-pyqt-guis/ for a description of an older version of this demo.
"""
This demo demonstrates how to embed a matplotlib (mpl) plot
into a PyQt5 GUI application, including:
* Using the navigation toolbar
* Adding data to the plot
* Dynamically modifying the plot's properties
* Processing mpl events
* Saving the plot to a file from a menu