Тёмный

High FPS animations in matplotlib 

Dave's Space
Подписаться 13 тыс.
Просмотров 35 тыс.
50% 1

See how blitting can be used to increase a matplotlib animation's fps by over 7x.
matplotlib is a plotting library for python, that produces publication quality plots. Unfortunately because they are publication quality, the time taken to set-up and draw the plot can be quite slow.
Typical animation framerates for redrawing plots are in the low/sub 10s. By using the FuncAnimation class along with blitting framerates over 60 fps are achievable.
This video is aimed at undergraduates or anyone interested in python.

Кино

Опубликовано:

 

31 мар 2022

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 23   
@curious9
@curious9 Год назад
Thanks, really good explanation! I was trying to improve animation performance myself in the last days, and one thing worth mentioning is that blitting works only with interactive backends, but if you are saving it to a movie it silently reverses to full redraw, which is not documented in FuncAnimation nor Animation classes, and it took me some time to realize by studying sources and debugging. So in that case you need to implement it yourself not relying on FuncAnimation.
@evancarpenter
@evancarpenter Год назад
Wait really‽‽‽ That is some really good information!! Thank you so much for commenting this :)
@randacoustics9269
@randacoustics9269 Год назад
Great video. Very informative for the tradeoffs of the different approaches!
@imotvoksim
@imotvoksim Год назад
Very nice overview, thanks a lot! My takeaway: fix the limits of axes to fit the final plot since the first frame and just blit away 😅
@stevehageman6785
@stevehageman6785 Год назад
Great information, thanks for sharing!
@Rwop81
@Rwop81 2 года назад
It's great...could you please share the python code?
@lameiraangelo
@lameiraangelo 2 года назад
This is great.
@t.p.2305
@t.p.2305 6 месяцев назад
Thank you, very useful!
@fergusjohnstone7604
@fergusjohnstone7604 Год назад
Great vid cheers. Would the fps be improved by updating more than one line at a time. Currently need to plot sensor data that comes in every 13.5ms but it occured to me i could maybe plot two data points every 27ms? Would this work? I realise it may look less smooth but this way it would only require 37fps to stay real-time right?
@johnteran8889
@johnteran8889 Год назад
For something like a simple count you can use a text object inside the canvas and update that.
@electron46
@electron46 Месяц назад
Thank you for your excellent video. On line 103 of your code, is shows lineL.set_data(t[frame], y[frame]) where frame is a single number from range(N). This produces an error. Please tell us why your code functions. Thank you!
@originuk
@originuk 9 месяцев назад
Nice to see how you went through the journey... Look at this... .. but if you do it this way ..... So yeah, don't get the UI to plot/scale ... and it's REALLY quick!
@rajatmond
@rajatmond 11 месяцев назад
Very invaluable and instructive video. I am making an automatic data logging device using a raspberry pi for my gf for her research work and I was searching for exactly this. Btw, any idea on how to decouple the data processing logic from the matplotlib gui? I really need to offload the data processing task to a different thread because it hangs the gui and the timings are way off. It is usually advised not to put time consuming code in gui event callbacks (here the events are probably some kind of timer events).
@Glanmire3
@Glanmire3 9 месяцев назад
I'm not a pro so my idea might not suits for you. I'm doing something like that. What I decided, I write the logged data in live to a csv file along with a timestamp so generate a graph I don't really need during the recording. (a device insert into a slot and the force recorded from a weight sensor readings). Because it's a .csv file easy to process later on even with excel.
@fergusjohnstone7604
@fergusjohnstone7604 Год назад
Also what is the function getfigax()? can't seem to find documentation on it
@SandBoardAssociation
@SandBoardAssociation 9 месяцев назад
He shows part of the function getfigax() around 1:16
@seokjinchung3694
@seokjinchung3694 Год назад
We want the code!!!!!!!!!!!!!! great thing : ) 🤧
@aspuser1081
@aspuser1081 Год назад
With animtion
@punjaramborhade1701
@punjaramborhade1701 Год назад
Friend where is code??? So we can try by our too...
@kychemclass5850
@kychemclass5850 Год назад
The code is in the video. The info Dave's Space shared is more than valuable enough for you to pause the video and write out the code manually. Like in the good old 80's computing days, and the code blocks aren't too big.
@Glanmire3
@Glanmire3 9 месяцев назад
@@kychemclass5850 You right and actually type in a code more useful to learn the language than just copy/paste only.
@aspuser1081
@aspuser1081 Год назад
How to kivy metapolt plt.gcf convert plt.show()
Далее
How to process Arduino data in Python
7:33
Просмотров 25 тыс.
Seaborn Is The Easier Matplotlib
22:39
Просмотров 161 тыс.
🎤Пою РЕТРО Песни ✧˖°
3:04:48
Просмотров 1,7 млн
Gale Now VS Then Edit🥵 #brawlstars #shorts
00:15
Просмотров 206 тыс.
Вечный ДВИГАТЕЛЬ!⚙️ #shorts
00:27
How I make science animations
43:39
Просмотров 692 тыс.
threading vs multiprocessing in python
22:31
Просмотров 562 тыс.
Matplotlib Animations in Python
12:22
Просмотров 169 тыс.
Making Animations in Python using Matplotlib!
22:05
Просмотров 7 тыс.
DFT filtering (digital photograph)
0:21
Просмотров 384