In this Pyqtgraph article iam going to talk about PyqtGraph Introduction Installation & Drawing Line.
So for the installation you can simply install by pip install pyqtgraph
The courses that you want to learn
1: Python Tutorial From Basics Up To OOP Concepts
2: PyQt5 GUI Development Articles
What is Pyqtgraph ?
PyQtGraph is a graphics and user interface library for Python that provides functionality commonly required in engineering and science applications.
Its primary goals are 1) to provide fast, interactive graphics for displaying data (plots, video, etc.) and 2) to provide tools to aid in
rapid application development (for example, property trees such as used in Qt Designer).
PyQtGraph makes heavy use of the Qt GUI platform (via PyQt or PySide) for its high-performance graphics and numpy for heavy number crunching.
In particular, pyqtgraph uses Qt’s GraphicsView framework which is a highly capable graphics system on its own;
we bring optimized and simplified primitives to this framework to allow data visualization with minimal effort.
It is known to run on Linux, Windows, and OSX.
What can it do ?
Amongst the core features of pyqtgraph are:
- Basic data visualization primitives: Images, line and scatter plots
- Fast enough for realtime update of video/plot data
- Interactive scaling/panning, averaging, FFTs, SVG/PNG export
- Widgets for marking/selecting plot regions
- Widgets for marking/selecting image region-of-interest and automatically slicing multi-dimensional image data
- Framework for building customized image region-of-interest widgets
- Docking system that replaces/complements Qt’s dock system to allow more complex (and more predictable) docking arrangements
- ParameterTree widget for rapid prototyping of dynamic interfaces (Similar to the property trees in Qt Designer and many other applications)
So now we are going to draw a line in Pyqtgraph
Code for PyqtGraph Introduction Installation & Drawing Line
1 2 3 4 5 6 7 8 9 10 |
import sys from PyQt5.QtWidgets import QApplication import pyqtgraph as pg app = QApplication(sys.argv) pg.plot(x = [0, 1, 2, 4], y = [4, 5, 9, 6]) status = app.exec_() sys.exit(status) |
OK now in the above code there are the imports for Pyqtgraph
1 2 3 |
import sys from PyQt5.QtWidgets import QApplication import pyqtgraph as pg |
This is the application object
1 |
app = QApplication(sys.argv) |
Also this is for drawing line in Pyqtgraph
1 |
pg.plot(x = [0, 1, 2, 4], y = [4, 5, 9, 6]) |
Now run the complete code and this will be the result
Also you can watch the complete video for this article
Subscribe and Get Free Video Courses & Articles in your Email