How to make a GUI using PyQt5 and Matplotlib to plot real-time data: PyQt5 tutorial - Part 10

preview_player
Показать описание
Today in Python, we will design a simple but beneficial graphical user interface (GUI) with PyQt5. We will plot live audio data, that is sampled from computer's audio device. We will use the Matplotlib figure and update the canvas in the GUI according to the set interval. We will use pyqtSlot, QTimer, QThreadPool, sounddevice, and queue in this tutorial. This is part 10 of the PyQt5 learning series.

IMPORTANT TUTORIAL LINKS

Рекомендации по теме
Комментарии
Автор

This is, simply outstanding. I'm learning Python and just recently forayed into the front end with PyQt5 and designer. Every tutorial I've found online (well to be fair, nearly every) does the same things, "Hello World". Combining all of the functionality into this app, including matplotlib, numpy, audio processing, this is just the kind of tutorial I've been looking for. I get it, the standard in the programming world is start with "Hello World" and build on it. However, too many never go anywhere substantial. The sample apps they create show some simple signals/slots, use of graphical elements, etc... but never end up anywhere substantial. Thank you. I'm hooked. Subscribed and diving into the material on your channel and web site. Lastly, tying your code base into interfacing with hardware and the raspberry pi? That's my jam. I've got a Pi4 with 8GB ram, 64bit OS and 240GB SSD (booting from). I run my dev environment on this and it absolutely ROCKS! Way to out SHINE the rest and provide lessons that actually go somewhere!

TheJacklwilliams
Автор

this is its the very very very best thing that i see in a long time, i really love this, i came here searching silver, and i found gold!!!

nikse
Автор

great tutorial. Thanks for posting. I will recommend to other learners.

rev
Автор

thank you very much just what i wanted

AhmadAsmndr
Автор

Hello Sir, how can we plot or scatter plot real-time CSV, txt data files?
Can you please help with it?

wonderman
Автор

it looks great. EVERYBODY I NEED HELP. I have a task that wants me to make a progressbar which will be updating/refreshing every second with the values that I take from somewhere. lets say its a list. I created a loop for updating it and added a delay time with time.sleep but it didnt work. it takes all the delay time at once and after looking at a blank window for 10 seconds i get a display of a progressbar with the last value in the array. PLEASE HELP

muhammedtahsintasgn
Автор

Really nice tutorial. I am trying to plot several page report with pyqt with alternating text and graphs with few push buttons. For example push button 1 will display some text for Milk sale per month with some matplotlib. I am finding it difficult to find a layout for such report. unfortunately i cant upload a sample pdf in comment section, so I am directly emailing you a sample pdf. Please share any idea how to generate such report.

uzmahamayun
Автор

Can we able to plot the graph without loading ui..i.e create the plot programatically

rithikarithika
Автор

Sample rate must be GREATER THAN twice the fundamental and should be much higher. (It takes a nearly infinite amount of time to resolve a signal if the sampling frequency is close to f/2.

charlesspringer
Автор

Any advise on how we can package this app to an exe?. From my experience packaging apps that make use of libraries such that matplotlib, numpy or pandas make huge executables that makes packaging essentially useless.

ipelezikis
Автор

I loved your video. I am still stuck tho, can you help me with something? I have a QWidget that has 2 tabs. Tab #1 handles data input and tab 2 plots it. I can not make it to work. I have my tab2 as a separate class but it's parent is tab1. I will say tho that main Data Strucutre (Dictionary) is outside my gui class.. do I need to put that inside? please help

milenamijuskovic
Автор

Hi great tutorials! I tried running the code but I keep getting:
'ValueError: Multiple input devices found for 'Microphone (NVIDIA Broadcast)':
[1] Microphone (NVIDIA Broadcast), MME
[27] Microphone (NVIDIA Broadcast), Windows DirectSound
[68] Microphone (NVIDIA Broadcast), Windows WASAPI

This unfortunately happens with every single audio device I try to use. MME, Windows DirectSound, and Windows WASAPI are always in the error message following the name of the audio device.

TlNYDlCK
Автор

Great work, pleas can I aske you some questions please ?

seifeddineomari
Автор

how can add command prompt in qt5 Designer

ashishprajapati
Автор

Great development, It was very useful for what I wanted to do. I have a question: You define the function Update_plot with a While loop, but this function is called periodically by QtTimer, so if You quit the While loop is still works. Is the While loop necessary for something else or is just redundant? I cannot see any reason why we would want it. Thank you for your dedication!!!

cristian
Автор

It's amazing but can you tell me details you show like sample rate, frequency are please help ?

surendrathakur
Автор

How to make it possible to change the window and other parameters in real time, while is already playing?

marverickbin
Автор

Any thoughts how you could plot csv data coming that comes streaming from a serial port? Basically, get all the ascii up to the carriage-return/line-feed, then parse / plot each csv value, before getting the next line of data. Or do you think the processing would take too long and drop serial data?

bennguyen
Автор

I completely copied your code, but Im getting this error:
QObject::killTimer: Timers cannot be stopped from another thread
QObject::startTimer: Timers cannot be started from another thread
QObject::setParent: Cannot set parent, new parent is in a different thread

wilykary
Автор

i need help, to change the input using a arduino

dimaskurniawan