The module pyqtgraph supports all kinds of charts and scientific graphics. Officially it’s the “Scientific Graphics and GUI Library for Python”. Underneath, pyqtgraph uses PyQt4 / PySide and numpy. Its been tested to work on Linux, Windows, and OSX.
In this article we’ll create an example bar chart. The output will be this awesome chart:
Related course:
Create PyQt Desktop Appications with Python (GUI)
pyqtgraph barchart
PyQtGraph is a pythpn graphics module built on top of PyQt and numpy. It’s end users are mathematicians, scientists and engineers. Lets do an example. We create the data to plot (x y1) first. y1 is a list of 20 floats that we create using the numpy method linspace.
Then create the barchart using the method BarGraphItem(), where the parameters are x, y, bar width and color.
# pyqtgraph examples : bar chart |