No video

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

  Рет қаралды 52,007

PyShine

PyShine

Күн бұрын

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.
Source code: pyshine.com/Ho...
Music: www.bensound.com
IMPORTANT TUTORIAL LINKS
Transfer video over sockets from multiple clients: pyshine.com/So...
How to track Mario in Python: pyshine.com/tr...
What are yield and return statements in Python: pyshine.com/Di...
How to automatically arrange the desktop icons: pyshine.com/Ho...
How to plot realtime frame rate of a web camera: pyshine.com/Ho...
How to make screen recorder in PyQt5: pyshine.com/Ho...
How to make a real time voice plot: pyshine.com/Ho...
How to make a piano in Python: pyshine.com/Ho...
Making Python GUI for sine and cosine: pyshine.com/Ho...
Pandas dataframe with hexadecimal and ascii values: pyshine.com/Pa...
Socket programming to send and receive webcam video: pyshine.com/So...
Faster and accurate object tracking in Python: pyshine.com/Ob...
OpenCV and Real time streaming protocol (RTSP): pyshine.com/Re...
How to deploy Python video processing application on the server: pyshine.com/Ho...
How to publish-subscribe video using socket programming in Python: pyshine.com/Fa...
How to send audio from a client computer to a server over the wifi: pyshine.com/Se...
How to visualize Earthquakes in Python: pyshine.com/Ho...
How to stream video and bidirectional text in socket programming: pyshine.com/Vi...
How to send audio data using socket programming in Python: pyshine.com/Ho...
How to send audio and video using socket programming in Python: pyshine.com/Ho...
How to send video using UDP socket in Python: pyshine.com/Se...
How to easily stream picamera video over wifi with Raspberry Pi: pyshine.com/Ea...
How to configure Raspberry Pi in Ad hoc wifi mode: pyshine.com/Ho...
How to easily stream webcam video over wifi with Raspberry Pi: pyshine.com/Ea...
How to easily install OpenCv in Raspberry Pi boards: pyshine.com/Ho...
How to stream multiple videos on an HTML webpage:pyshine.com/Li...

Пікірлер: 53
@TheJacklwilliams
@TheJacklwilliams 2 жыл бұрын
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!
@pyshine_official
@pyshine_official 2 жыл бұрын
You're welcome and glad its helpful
@nikse2028
@nikse2028 3 жыл бұрын
this is AWESOMEEEEEEEEEEEEEEEEE!!!!!!!!!!!!!!!!!!!!!!!, 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!!!
@8051rev8051
@8051rev8051 2 жыл бұрын
great tutorial. Thanks for posting. I will recommend to other learners.
@yunusemreaslan3016
@yunusemreaslan3016 2 жыл бұрын
GREATTT!! Thanks a lot!!!
@AhmadAsmndr
@AhmadAsmndr Жыл бұрын
thank you very much just what i wanted
@pyshine_official
@pyshine_official Жыл бұрын
Glad I could help
@lamify_pro
@lamify_pro 3 жыл бұрын
Thanks!!!
@1029cristian
@1029cristian Жыл бұрын
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!!!
@pyshine_official
@pyshine_official Жыл бұрын
Good question, the while can be avoided, simple replace the try except queue.Empty part with data=[0]
@wonderman2864
@wonderman2864 2 жыл бұрын
Hello Sir, how can we plot or scatter plot real-time CSV, txt data files? Can you please help with it?
@pyshine_official
@pyshine_official 2 жыл бұрын
Hi, please follow this pyshine.com/How-to-plot-real-time-frame-rate-in-opencv-and-matplotlib/ and instead using plt.plot you can work around with plt.scatter
@wonderman2864
@wonderman2864 2 жыл бұрын
@@pyshine_official thank you so much, Sir! Good luck with your further works :)
@ipelezikis
@ipelezikis 2 жыл бұрын
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.
@pyshine_official
@pyshine_official 2 жыл бұрын
Yes the package might be large, use pyinstaller
@uzmahamayun8375
@uzmahamayun8375 2 жыл бұрын
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.
@pyshine_official
@pyshine_official 2 жыл бұрын
Probably the closest one is this pyshine.com/Drag-Drop-CSV-File-on-PyQt5-GUI/ Saved your data to csv and use this tutorial for text you can add label under the graph. The text in that label will come from some test file or even from the same csv. For example you can add an extra column in csv that will contain the relevant text for each plot. Bind a bush button to load csv and display data and text
@seifeddineomari4962
@seifeddineomari4962 3 жыл бұрын
Great work, pleas can I aske you some questions please ?
@muhammedtahsintasgn3089
@muhammedtahsintasgn3089 2 жыл бұрын
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
@pyshine_official
@pyshine_official 2 жыл бұрын
This might be helpful focus on the progressbar pyshine.com/Play-Rock-Paper-Scissors-Game-using-PyQt5-GUI/
@rithikarithika1230
@rithikarithika1230 2 жыл бұрын
Can we able to plot the graph without loading ui..i.e create the plot programatically
@rithikarithika1230
@rithikarithika1230 2 жыл бұрын
is it possible?
@pyshine_official
@pyshine_official 2 жыл бұрын
Yes we can plot pyshine.com/How-to-make-a-real-time-voice-plot/
@charlesspringer4709
@charlesspringer4709 Жыл бұрын
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.
@milenamijuskovic2340
@milenamijuskovic2340 Жыл бұрын
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
@milenamijuskovic2340
@milenamijuskovic2340 Жыл бұрын
I would really really appreciate it, I am at this issue more than a week now. As a beginner I find it very difficult
@ashishprajapati6128
@ashishprajapati6128 2 жыл бұрын
how can add command prompt in qt5 Designer
@pyshine_official
@pyshine_official 2 жыл бұрын
Good question, it will be added on pyshine.com, stay tuned
@TlNYDlCK
@TlNYDlCK Жыл бұрын
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.
@duncpol
@duncpol Жыл бұрын
You have to use a simple 3.5 mm jack microphone, not a webcam.
@surendrathakur3479
@surendrathakur3479 3 жыл бұрын
It's amazing but can you tell me .......the details you show like sample rate , frequency are right...... please help ?
@pyshine_official
@pyshine_official 3 жыл бұрын
Yes, these are input parameters and works well as long as hardware allows
@surendrathakur3479
@surendrathakur3479 3 жыл бұрын
@@pyshine_official it's very confusing.....how can you make sample rate of 44100 hz from mic input
@pyshine_official
@pyshine_official 3 жыл бұрын
@@surendrathakur3479 Hi, the mic input is analog signal provided to an analog to digital converter of your sound device. The sample rate is given to sound device digitizer. By default most audio digitizers can sample sound at this rate
@surendrathakur3479
@surendrathakur3479 3 жыл бұрын
@@pyshine_official you are awesome and clearing all my doubt........does downsample drop every 10th sample of the sound by your program.......or can I change all the parameter written in gui....... please I beg to you help me out, the question may arise when I show it to my guide
@kutilkol
@kutilkol 2 жыл бұрын
wow! how you did that?
@marverickbin
@marverickbin 3 жыл бұрын
How to make it possible to change the window and other parameters in real time, while is already playing?
@pyshine_official
@pyshine_official 3 жыл бұрын
Excellent question! Since functions are running under various threads with their own parameters. We can use seprate queue based variables to safely provide the parameter value a thread running a function. In that fuction the parameter value can be applied before the next time step.
@azharabbas6298
@azharabbas6298 3 жыл бұрын
How to run nmap im pyqt design
@bennguyen1313
@bennguyen1313 3 жыл бұрын
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?
@pyshine_official
@pyshine_official 3 жыл бұрын
Hi! serial port data can be plotted by each chunk, depending on the baud rate the stream of chunks can be appended to a csv file. And in a separated thread simple read that csv and plot. In that way the serial data will not drop and can be plotted.
@jaganmohan5099
@jaganmohan5099 3 жыл бұрын
@@pyshine_official thank you.. how can i do this with separate thread
@wilykary
@wilykary 3 жыл бұрын
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
@pyshine_official
@pyshine_official 3 жыл бұрын
Hi, Please use this for stopping pyshine.com/PyQt5-Live-Audio-GUI-with-Start-and-Stop/
@wilykary
@wilykary 3 жыл бұрын
@@pyshine_official 👍
@dimaskurniawan1924
@dimaskurniawan1924 2 жыл бұрын
i need help, to change the input using a arduino
@pyshine_official
@pyshine_official 2 жыл бұрын
Hi, please elaborate the format of data, is it serial or text based?
@dimaskurniawan1924
@dimaskurniawan1924 2 жыл бұрын
@@pyshine_official its serial data
@dimaskurniawan1924
@dimaskurniawan1924 2 жыл бұрын
can you explain how to change input based on serial plotter from arduino, please?
QtDesigner and PyQt5:  The right and wrong way to use them together
37:16
Alan D Moore Codes
Рет қаралды 108 М.
Before VS during the CONCERT 🔥 "Aliby" | Andra Gogan
00:13
Andra Gogan
Рет қаралды 10 МЛН
Мы сделали гигантские сухарики!  #большаяеда
00:44
PEDRO PEDRO INSIDEOUT
00:10
MOOMOO STUDIO [무무 스튜디오]
Рет қаралды 18 МЛН
How to plot csv file data: PyQt5 tutorial - Part 06
13:49
PyShine
Рет қаралды 15 М.
Create Stunning Python GUIs in 10 Minutes With Drag & Drop
11:38
Coding Is Fun
Рет қаралды 56 М.
High FPS animations in matplotlib
13:22
Dave's Space
Рет қаралды 36 М.
Hack your brain with Obsidian.md
11:53
No Boilerplate
Рет қаралды 1,9 МЛН
How to Plot Real Time Serial Data on Python GUI??
25:36
Dr. Sachin Sharma
Рет қаралды 47 М.
Convert py to exe - from code to software
5:55
Python Simplified
Рет қаралды 472 М.