{"id":5026,"library":"pyqtgraph","title":"PyQtGraph","description":"PyQtGraph is an open-source Python library for scientific graphics and GUI development, built on top of Qt and NumPy. It provides fast, interactive plotting for large datasets, signal/image processing, and sophisticated GUI elements, making it ideal for scientific and engineering applications. The current version is 0.14.0, and it maintains a relatively active release cadence with several minor and patch releases per year.","status":"active","version":"0.14.0","language":"en","source_language":"en","source_url":"https://github.com/pyqtgraph/pyqtgraph","tags":["graphics","GUI","plotting","scientific","Qt","data-visualization"],"install":[{"cmd":"pip install pyqtgraph","lang":"bash","label":"Base installation (requires separate Qt binding)"},{"cmd":"pip install pyqtgraph[PyQt6]","lang":"bash","label":"Install with PyQt6 binding"},{"cmd":"pip install pyqtgraph[PySide6]","lang":"bash","label":"Install with PySide6 binding"},{"cmd":"pip install pyqtgraph[PyQt5]","lang":"bash","label":"Install with PyQt5 binding"},{"cmd":"pip install pyqtgraph[PySide2]","lang":"bash","label":"Install with PySide2 binding"}],"dependencies":[{"reason":"Required for numerical operations and data handling.","package":"numpy","optional":false},{"reason":"One of these Qt bindings is required for the graphical user interface components to function.","package":"PyQt5 / PyQt6 / PySide2 / PySide6","optional":true}],"imports":[{"symbol":"pyqtgraph","correct":"import pyqtgraph as pg"},{"symbol":"QtWidgets, QtCore","correct":"from pyqtgraph.Qt import QtWidgets, QtCore"},{"note":"While `QApplication` works, `pg.mkQApp` is the recommended way to create or retrieve the QApplication instance, ensuring proper initialization and avoiding issues if an instance already exists.","wrong":"app = QtWidgets.QApplication([])","symbol":"mkQApp","correct":"app = pg.mkQApp('Your App Name')"}],"quickstart":{"code":"import pyqtgraph as pg\nfrom pyqtgraph.Qt import QtWidgets\n\n# Always start by creating a QApplication\napp = pg.mkQApp(\"PyQtGraph Quickstart\")\n\n# Create a GraphicsLayoutWidget (a window to hold plots)\nwin = pg.GraphicsLayoutWidget(show=True, title=\"Basic Plot\")\nwin.resize(800, 500)\nwin.setWindowTitle('PyQtGraph Quickstart Example')\n\n# Enable antialiasing for prettier plots\npg.setConfigOptions(antialias=True)\n\n# Add a plot item to the window\np = win.addPlot(title=\"Simple Line Plot\")\n\n# Generate some data\ndata = [1, 5, 2, 4, 3, 8, 9, 1, 2, 3, 5]\n\n# Plot the data\np.plot(data)\n\n# Start the Qt event loop if running as a script\nif __name__ == '__main__':\n    QtWidgets.QApplication.instance().exec_()","lang":"python","description":"This quickstart demonstrates how to create a basic line plot using PyQtGraph. It sets up a QApplication, creates a `GraphicsLayoutWidget` as the main window, adds a plot item, and plots a simple list of data. Crucially, it uses `pg.mkQApp` for application initialization and `app.exec_()` to start the Qt event loop, allowing the GUI to run."},"warnings":[{"fix":"Review your code for usage of these deprecated classes. For multi-plotting, consider using `GraphicsLayoutWidget` with multiple `PlotItem` instances or alternative approaches.","message":"The classes `MetaArray`, `MultiPlotItem`, and `MultiPlotWidget` have been removed.","severity":"breaking","affected_versions":"0.14.0"},{"fix":"Upgrade your Python environment to 3.9 or higher and NumPy to version 1.21 or higher to ensure compatibility.","message":"Support for Python 3.8 and NumPy 1.20 has been dropped.","severity":"breaking","affected_versions":"0.13.4 and later"},{"fix":"Ensure your installed Qt binding (PyQt5, PyQt6, PySide2, or PySide6) meets these minimum version requirements. Upgrade your Qt binding if necessary.","message":"Minimum supported Qt versions have been increased to Qt5 5.15 and Qt6 6.2+.","severity":"breaking","affected_versions":"0.13.0 and later"},{"fix":"Avoid using `GraphicsObject::parentChanged`. Look for alternative signals or methods if you were relying on this for parent change detection.","message":"The `GraphicsObject::parentChanged` method has been deprecated.","severity":"deprecated","affected_versions":"0.13.1 and later"},{"fix":"Always include `app.exec_()` (or `app.exec()` on some platforms/Qt versions) at the end of your script after setting up your GUI, typically guarded by `if __name__ == '__main__':`.","message":"Forgetting to start the Qt event loop or calling `QApplication.exec_()` (or `exec()`) can lead to the GUI window appearing briefly and then closing, or not appearing at all.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-12T00:00:00.000Z","next_check":"2026-07-11T00:00:00.000Z"}