I hope everyone finds this video helpful. The next video of the series will be posted tomorrow at the same time. The next video will cover subplots. Subplots are used to work with plots in a more object-oriented manner and also allow us to plot multiple different graphs at the same time. I'd like to thank Brilliant for sponsoring this series. If you'd like to check them out then you can sign up with this link and get 20% off your premium subscription: brilliant.org/cms
@ahmedhassanahmedhassan64955 жыл бұрын
waiting for subplots :)
@anonymous-kl1un5 жыл бұрын
How many more to go in this series?
@coreyms5 жыл бұрын
@@ahmedhassanahmedhassan6495 Subplots tutorial will be released tomorrow morning
@coreyms5 жыл бұрын
@@anonymous-kl1un Tomorrow's video will be the last video for the time being. If I get many requests to cover topics that I didn't then I can continue adding to this series.
@m.s.10125 жыл бұрын
you are doing great work,keep it up
@jnce964 жыл бұрын
For those using Jupyter Notebook, adding this line at the top of the notebook will make the graph appear: %matplotlib notebook
@matiascardone6354 жыл бұрын
Thanks :D
@confidencechidiebere45094 жыл бұрын
Thank you John, I was struggling with this for two days and wondered why the graph is not showing. Why do we have to call "notebook"?
@visharadverma99034 жыл бұрын
Dude thank you sm, you're a lifesaver!!!
@karthiavenger45774 жыл бұрын
Thank you sooo much bro but why notebook ??
@Am-hsb4 жыл бұрын
Thanks a lot mate
@BiancaAguglia5 жыл бұрын
This was another great tutorial, Corey. And yes, please do a video about plotting real time data from an API. 😊 Thank you for all your hard work.
@Iknowpython5 жыл бұрын
One of the main reason why python is one of the best is because of its huge community contributing in creating libraries and matplotlib is definitely one of the finest library for data visualization
@nagabhushanr55994 жыл бұрын
Hey I know python....can you tell me what is the importance of i in animate function I donno wat is passed through that parameter
@renujain891111 ай бұрын
Whenever I got stuck then first channel I look for is Corey Schafer.... Your teaching style is something which no one seems to be matching.... So simple to understand any kind of difficult or complex topic.... Great Work :-)
@alexandreperron40973 жыл бұрын
There is a special place in heaver for guys like you. Thank you so much. This is by far one of best things I saw on KZbin
@confidencechidiebere45094 жыл бұрын
This is the toughest video in this series. I spent hours trying to figure it out but to no avail. I will pass and come back in the future. Perhaps by then, I would have gained more knowledge that will help me understand it. Excellent videos. Thank you!
@yash11522 жыл бұрын
16:48 > _"there's a way we'd've updated ... w/o clearing out the axis ... & just update the lines on the axis with live data"_ thanks a lot for mentioning that clearly and not brushing it under the rug. i was thinking the same the whole time as clearing and redrawing all the data seems pretty inefficient to me
@bokkenka5 жыл бұрын
Nice videos. A tip for this one that might be useful: You can slice the data follow only the last X number of entries rather than seeing all the data bunch up tighter and tighter. Let's say you only care about the last minute... Add a `[-60:]` on the end of the `x=...`, `y1=...`, and `y2=...` lines.
@agustinbmed2 жыл бұрын
oh dude, this info is great! thank you!
@diegoroy982 жыл бұрын
amazing. thanks for the tip. really helful
@clementstore5 жыл бұрын
Thank you very much. Your videos are better than most paid courses. That is a fair comment.
@mrmuranga4 жыл бұрын
Corey, thanks... anyone who chose to use jupyter notebooks, incase your plots are not showing especially the live plots....and getting a mesg such as "figure size 432x288 with axes 0", would recommend you save the file you want to run as py file and then run it directly from the terminal....ensure though that in your terminal you have installed matplotlib and pandas via pip....
@ZsoltPal23092011 Жыл бұрын
Just simply love the idea in this video. Made it to a rolling (scrolling?) plot - if the data reaches 30+, it only plots the last 30, looks interesting. Thank you Corey, you are brilliant! Edit: changet it to 200 and added a try/except so that the plot can be started before the csv generation. I love this :) Thank you again Corey for this amazing video.
@youngzproduction74985 жыл бұрын
I learn a lot from your vids. Literally, a lot. I hope you keep updating your tutorial more. This clip helps me understand how the plot updating itself. Thanks million times.
@ahmedyasser43505 жыл бұрын
Congrats on 300k, your videos are straight to the point and explained extremely well!
@coreyms5 жыл бұрын
Thanks!
@disneycharacters9684Ай бұрын
@@coreyms can you please tell me, that how could I do that command on the command prompt, as I enter the python data_gen.py.... it says there is no such directory.. please help
@ngkahing3 жыл бұрын
once again it so happens that when i search forrealtime plotting, it came up this great tutorial and only until in the mid of video that i found out its THE Corey Schafer - the better than paid courses Master Coach. Salute.
@SolvingOptimizationProblems5 жыл бұрын
This is exactly what I'm looking for. It worked for me. Many thanks sir
@woodziss38885 жыл бұрын
Great video. Would be interesting to see how can one integrate this updating plot within a PyQT GUI.
@rutviktak7164 жыл бұрын
Thanx mman,you'r helping lot of people.learned a lot from your channel and would like to pay it forward in the future just by sharing what i learned😊
To make the graph appear when using spyder, add %matplotlib qt to the top of your file.
@louis-mbras89863 жыл бұрын
you made my day
@sheroichi7728 Жыл бұрын
@@louis-mbras8986 literally mine to
@kevingroovy86483 жыл бұрын
Dude you helped me out a lot!!! Thank you so much for taking the time to make this video. Subscribed to your channel
@toothzombie3 жыл бұрын
Corey love your videos! Saved my butt a few times. Feedback: Can you show the end result of what you want to accomplish before jumping into the code? I know I can fast forward to the end...it just flows better IMO
@tireldenamse58545 жыл бұрын
I really love this series! Thanks so much for your help!
@chadbrubaker79949 ай бұрын
Excellent video. Thanks so much for making this!
@zainkhalid36702 жыл бұрын
Can you help me? I'm facing an error. I've the exact code that you have at 6:12 Error: UserWarning: Animation was deleted without rendering anything. This is most likely unintended. To prevent deletion, assign the Animation to a variable that exists for as long as you need the Animation. warnings.warn(
@KirillBezzubkine5 жыл бұрын
man you are awesome at showing and explaining
@kantulaev5 жыл бұрын
Go seaborn tutorial bro
@timstark67445 жыл бұрын
Great video Corey, thanks!
@madhankumar36875 жыл бұрын
Can you please make tutorials on opencv library.
@GiggsBeckham5 жыл бұрын
This is so COOL! I'm gonna try this at work tomorrow.
@mustafaalwash69523 жыл бұрын
after you added your CSV file 11:28 why did you not remove the 'index=count()' there isn't any use for it anymore in the code right?
@saejfn3 жыл бұрын
What a good explanation. Thanks
@faqihmoch86392 жыл бұрын
Thank you very much Sir, it means a lot to my project.
@Nature-pb9dh3 жыл бұрын
Thanks man, this was really helpful.
@freeelectron82615 жыл бұрын
Great tutorial! Thanks Corey! Just subscribed :)
@swannschilling4743 жыл бұрын
Great tutorial!! Just what I needed!!
@meetpanchal49082 жыл бұрын
1 Query !! If I want to plot the data that's not live but I want the effects like (The line is moving in upward or downward data) How can I plot it ? any suggestions ?
@omzehn98723 жыл бұрын
thanks man! Really helpful video :)
@Gndt1 Жыл бұрын
Excellent video. Would be nice to show how to plot a scrolling window on the data, IE just show the last 'x' values.
@chwenjun225 Жыл бұрын
So cool, thanks you so much for the video 🥰
@saraghafelehbashi58082 жыл бұрын
Thank you for saving our time
@mallusreddy5 жыл бұрын
Wow it's really great video.. Thank you so much sir..
@TopicalAuthority4 жыл бұрын
Anyone knows the meaning of '' ? I am using the default codes from Corey's github account.
@leocallebaut35484 жыл бұрын
if you're on jupyter notebook, use %matplotlib notebook at the top of your code. It should work fine.
@trishanag52323 жыл бұрын
@@leocallebaut3548 But it shows me blank figure
@mnicp013 жыл бұрын
fantastic explanation! thank you
@vishalmishra19374 жыл бұрын
No doubt why he is one of the best
@zakwan31694 жыл бұрын
great video sir
@pushpajitbiswas37525 жыл бұрын
Nice one 👍👍👍
@stellarspacetraveler2 жыл бұрын
You can put a try-except in the animate function which will prevent the program from crashing before any data has been written to the data.csv file. That way you can start the data logging program before any data is generated.
@raphaelmok7122 жыл бұрын
@6:14 -- running the script gives me the output, . It does not return an updating chart. can i know what am I missing?
@dataScineceEnthusiast2 жыл бұрын
if you are using jupyter notebook try using either %matplotlib inline or %matplotlib notebook
@alilo49434 жыл бұрын
Thank you, professional for your help😘😘😘🙏🙏
@mohammadbasheer61924 жыл бұрын
thank you very much for this playlist sir, it was very helpful for me
@ThePasupathi5 жыл бұрын
Hi Corey, May i know the meaning of argument "i" in animate function?
@coreyms5 жыл бұрын
That is the interval. It’s something that is automatically passed in by the library
@mangoyumm4 жыл бұрын
@@coreyms Can you explain this a bit more? Normally, an input argument is used in the definition of the function, but I see that is not the case here....however, when I try to run my code without "i", then the plot is empty, so it's obviously useful...?
@sudeeppatel74634 жыл бұрын
@@mangoyumm Hey there, actually the "i" here refers to 'self' as you know that you need to pass the "self" parameter in python function is used to access arguments inside the function so now if you use self instead of "i" then you can see that the plot can be plotted and without it the function arguments are not accessed. I hope you find this helpful. Happy Coding. Also you can use anything instead of self .
@girardaquino4 жыл бұрын
@@sudeeppatel7463 would it have mattered if he just left it blank? In which case that would refer to self right?
@sudeeppatel74634 жыл бұрын
Girard Aquino yes that’s by default in python but whenever you are calling a function in class you need to write self . Outside the class if you write self and then execute the program you will get a error stating “ required 1 argument but 2 were given or 2 argument 1 was given “ . But other than that it’s by default in python .Hope it helps
@alexanderten54975 жыл бұрын
Great tutorial as well. You should teach in university. I wish you could be my professor
@ulfgj5 жыл бұрын
he does. he is. this is youtube presenting us dr. cms.
@Deepsim3 жыл бұрын
Very clear tutorial
@markkennedy9767 Жыл бұрын
Thank you. Couple of questions: What does the parameter i in the animate function refer to. What argument (if any) are we passing to this function when we call it. How is the animate function actually being called by what seems to be the animate argument for FuncAnimation. Why is the FuncAnimation function assigned to the variable Ani; We don't seem to use Ani anywhere else. Thanks
@axelwetterlundh42925 жыл бұрын
I have a problem at 6:14. When I run the code it does not display the plot. Instead it just says . I don't know what I am doing wrong. I am using python 3.7
@mrmvpick5 жыл бұрын
I finally figured it out. Go to Tools -> Preferences -> IPython console -> Graphics -> click dropdown next to 'Backend' and select "Automatic". Then click apply, close Spyder, and reopen. I'm thinking it should work for other IDE's the same way.
@elugamrajashekar98744 жыл бұрын
May be you use IPython (Jupyter Notebook) Remove the "plt.show()" from your code the plot will display. and that is not an error, it's a memory location of plot.
@muhammadishaq2532 Жыл бұрын
@Corey Schafer, I am having trouble to graph values of two parameters generated from python code included loops with multiple if statements. each iteration generate one value of required parameter, and graphing these against the variable responsible of change in values is need! looking for help.
@chiragpalan97803 жыл бұрын
One question, what is 'i' inside function animate()??
@TheSilvax Жыл бұрын
great totorial, thank you!
@gnosis92664 жыл бұрын
The starting code is not working in jupyter notebook. I am simply getting a blank graph.
@vinayaksharma-ys3ip3 жыл бұрын
Great tut!!!
@amarbs32875 жыл бұрын
Hi how to plot real time data such that only certain amount of samples are shown ... Here as time goes on the graph would have so many values
@malayparmar5044 жыл бұрын
Can you please tell why you add input argument 'i' in your animate function? I don't see any use of 'i'
@mustapha-d2k3 жыл бұрын
How would you do a time series for an hourly time series? example 2021-01-20 23:00
@arsenalfanism5 жыл бұрын
"Corey Schafer"
@alanmoreno63302 жыл бұрын
nice
@1CJK13 жыл бұрын
Great!! Thanks!😁
@jimevega81133 жыл бұрын
thaank youuu! this save my final work today
@milnepe5 жыл бұрын
Matplotlib is a great series, thanks! How would you plot a fixed period, say like the last hour of data for a time series so it keeps rolling along?
@johanknelsen44435 жыл бұрын
Very nice video. It would be nice to have this display through a web server that could be made available on a local network.
@a_mortal75115 жыл бұрын
Thanks a dozen times, with the guide of your tutorial series "Python Django" I was able to build my first website in django. I wish you could do an API series with Django Rest Framework, I get really challenged when it comes to db modeling and normalization.
@mostafaelnady78275 жыл бұрын
really nice corey , but i have a dummy question why you not execute the function animate and also why you don't pass a value for the argument( i ) ?
@IntegralDeLinha2 жыл бұрын
Great! Thanks for that!
@nmana97594 жыл бұрын
At 8:42, at Line 13&19, what is the difference between 'w' and 'a' when opening the csv file? I couldn't find the answer anywhere
@lilbacon77774 жыл бұрын
Those are both arguments that show what you want to do with the file. The 'w' argument stands for write, so you're writing the headers onto the CSV you created. The 'a' argument stands for append, which is a fancy word for add to already existing data entries. This, using the 'w' (write) argument, will tell the program to open up the CSV file with the intent to write data onto it, in this case the headers. *_with open('data.csv', 'w') as csv_file:_* This, using the 'a' (append) argument, will tell the program to open up the CSV file with the intent to add onto already existing data. *_with open('data.csv', 'a') as csv_file:_* He updated the data by using the following lines of code, to APPEND random integers to the already existing data entries: *_x_value += 1_* *_total_1 = total_1 + random.randint(-5, 8)_* *_total_2 = total_2 + random.randint(-6, 4)_* Hopefully this helped! Reply for clarification.
@nghiepcrypto70344 жыл бұрын
A nice video, and yes please do an API live plotting video. Maybe google analytics or KZbin ApI. I prefer KZbin Api. Thanks
@punjaramborhade17013 жыл бұрын
U should have shown csv file, how values there n how it's plotting through code... Would be easy to understand..
@papaalphaoscar55373 жыл бұрын
What is that (i) argument for the animate function? What are you passing into the function? It throws an error when I remove it. Thanks.
@slonbeskonechen83103 жыл бұрын
Great! Thank you!
@anantpatel54443 жыл бұрын
message comes in consol and nothing gets plotted when i tried this code please help other than that your explanation is pretty good
@zeebay0033 жыл бұрын
Excellent
@agustinbmed2 жыл бұрын
this is wonderful, I really love your videos! I had a question for you tho... have you noticed a degradation in plotting after 1000+ data points? I'm running my tests in an old old system and running the data generator and the plot scripts at the same time causes my plot to plot ever so slowly... I gather it's the resources on my computer, but I'm thinking long term if I wanted to plot say a sensor with a "better" computer, will I have similar issues when acquiring this data? Thanks!
@dusk_r20692 жыл бұрын
Hi! I'm stuck with the exact same problem, did you find any work-around in these months?
@razahyder97964 жыл бұрын
thanks for this masterpiece, however wondering how to update the most recent value on graph instead of plotting the whole graph again and again with the new values.
@bennguyen13134 жыл бұрын
How would you plot the data from a binary file (i.e. non-ascii/binascii.unhexlify/csv)? For example, to support 8/16/24/32 bit data, I assume you would have to use bytearray/ord to construct each data elements from the byte(s), and save into an array of that data type? But how would you loop thru the file, grabbing 1,2,3 or 4 bytes to construct? int.from_bytes(b XXXXXX , byteorder='big', signed=false)? Is struct.pack needed?
@francist39795 жыл бұрын
Amazing Work! API PLEASE!!!
@ReflectingMe20243 жыл бұрын
Excellent and very informative video Corey, thanks. May I ask is there a way to make the graph 'scroll' once a set number of data items have been reached. So say we always wanted to display the last 200 readings; rather than have the plot to continue to grow on the x axis, could we show the last 200 in a real-time plot?
@ahmdktr80504 жыл бұрын
that was helpful ,thank you
@danielalegriasallo55513 жыл бұрын
After finishing this series I'm gonna watch your pandas tutorials
@peterjohn.v.82583 жыл бұрын
One question. Can somebody help. It is mentioned MATPLOT lib will run FuncAnimate repeatedly as mentioned in interval parameter. In the example plt.tight_layout() and plt.show() are there after FuncAnimate. Are these lines also executed each time FuncAnimate is executed? Do they happen in a liner fashion or in asynchronous manner? What if there are blocks of code before or/and after FuncAnimate? Will they be executed once or repeatedly as per interval parameter? Can someone please throw some light on this?
@vitaly10852 жыл бұрын
why after run first example where we start to use FunkAnimation I get nothing or empty plot and why it doesn't run multiple times based on interval and runs only ones?
@tylersnard4 жыл бұрын
Hello. Is there any way to do this by scrolling rather than squishing?
@sivarajchinnasamy114 жыл бұрын
sir may i know how to plot graph from the video input (no of peoples come inside per sec under the surveylence camera)
@zaalures18683 жыл бұрын
how do you ensure that both scripts are not trying to access the csv simultaneously ? I am writing a script that will be plotting data from a sensor for a test that can run for up to 36 hours at a time. I can't afford for the csv to get corrupted
@sebastianvazquez27393 жыл бұрын
I have a problem. The CSV is working but when I plot it, the matplotlib only shows the first three seconds. I think that is cause by the figure configuration but when I have no results change them with xlim in code or the configuration in figure editor
@biancacruz-hernandez81865 жыл бұрын
Is is possible to create a live-time histogram of live data? For example if I had a servo that rotated 10 degrees every 15 min and detectors where attached to this, could i create a bar graph that plotted the detectors live data stream in accordance to the current angle the detectors are positioned?
@tonyomalle7 ай бұрын
I followed your teaching every step of the way, and I am experiencing difficulty. The csv file is created and data is written but with empty rows in-between. I believe these empty rows tend to trigger an error around the x-index whenever I plot the series. Would you be kind enough to proffer a solution to this?
@fowad273 жыл бұрын
Is it possible to generate random numbers and append them to the x_vals and y_vals lists instead of writing to CSV and then reading from csv?
@geektom88985 жыл бұрын
Hi Corey Schafer, please can you add a tutorial about account checker how its work and how we make it with python
@MamounMraish5 ай бұрын
Thank YOU!!!!!
@mergenstudios87794 жыл бұрын
uuuh is there a way to make the x achis like pass thorugh the window so it doesnt get clttered up? or how to make seconds to like minuites in that x achis scaling thing?
@abhinav95614 жыл бұрын
Thanks man!!
@Stinosko5 жыл бұрын
Is using asyncio for writing the data better performance wise? As is will not block the threat it's at during the sleep?