Add QT GUI to Python for plotting graphics
Qt framework (with QT Creator IDE) can be used to create a fancy interfaces for Python GUI application. Plotting graphics on a GUI is possible with pyqtgraph library.
Installing pyqtgraph –
There are several ways of installing pyqtgraph depending on your needs.
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning - Basic Level Course
If you are using Anaconda you can install with:
conda install -c anaconda pyqtgraph
Or with pip command:
pip install pyqtgraph
Creation of plot widgets with QT Creator –
Add the buttons, text areas and other stuffs as usually done with QT Creator. To create a plot area you need to follow the steps:
- Add widget to UI and give it a proper name like “widgetSignal”
- Promote the widget to pyqtgraph
Load UI to Python –
- In your python code call the UI you created with QT Creator.
- Create a sin wave for plotting
- Draw the graph on UI