Build a Quick Animation with ipywidgets // ipywidgets play example
Вставка
- Опубліковано 21 лип 2024
- Learn how to quickly use Python to make an ipywidgets animation in this tutorial video. I first show you an example of how to create a basic ipywidgets play widget for a moving sine wave with matplotlib. We use ipywidgets Python to animate the plot with ipywidgets interact, and you get to see the ipywidget examples in Jupyter. Next I show you some additional options like selecting the loop button to make Python animate the plot in a loop. We talk about updating the function to account for the default integer values of the ipywidgets play widget, and we also discuss setting plot limits to make sure your animation looks consistent. Finally, I demonstrate how you can add other widgets control other parts of your animation with an example of an ipywidgets slider with the play widget.
0:00 Introduction
0:19 Animation Basics
4:45 Looping
5:40 Update Integers
6:24 Fix Plot Limits
7:18 Add Other Widgets (+ Slider)
9:36 BLOOPERS!
// GitHub CODE:
github.com/kimfetti/Videos/bl...
// Related VIDEOS:
Introduction to ipywidgets - • Introduction to ipywid...
Ipywidgets Interact - • Ipywidgets Interact Fu...
#dataviz #ipywidgets - Наука та технологія
Ms. Fessel: thanks for your instructions. I was getting nowhere fast looking up other answers to the basic Interact() method. The other methods seemed to depend upon "backend" and other subtle configurations ... none of those examples worked, ...
But yours did, and I have figured out how to extend well beyond your sine_wave example.
Thank you
Fun stuff! Animations like this would be awesome for teaching.
Yes! I absolutely enjoy using animations (as well as other widgets) for teaching. Would love to see more of these in math/data science programs as well as business applications for exploring how various parameters influence outcomes.
Neat!!!
Thank you very much for your video.
Cheers!!!
Congrats for the very clear instructions! Do you know if there is a way for, in your given example, to make possible to either play the graphs like an animation an simultaneously control it via a slider?
It would be very usefull for me as a teacher so I can show how it envolves in time and have a clear control of specific time cordinates to show properties.
Thanks much! Great question, and I believe it's similar to another one of this thread. Ultimately, I'm not sure how to use both a slider and the play button for the same element. You can have multiple widgets for the same function ( stackoverflow.com/questions/66566606/python-ipywidgets-functions-that-links-multiple-widgets-in-different-functions) but you may need to switch to observe instead of interact. My guess is that you could write a function where both the play button and the slider feed into the same function to control the output, but I haven't tried it.
thanks a lot
thank you
Glad it helped - cheers!
Great explanation as always, I was wondering why don't you use Jupyter lab?
Thank you! I really just haven't tried JupyterLab yet - it looks cool!
How do i increment in float value for play widget??
Very interesting! I was wondering if we can insert python widgets to ppt presentation. That would be very helpful!
Great question! I haven't tried this, but I am curious about it, too. I have been thinking of making a video about exporting and embedding ipywidgets. Hopefully soon!
@@KimberlyFessel yes please
Good morning. On my plot aria, my x-axis labels are constricted. (unable to read.) I have tried some codes (text rap) but it is not working. Any advice, please
is there a way to have the slider and play button affect the same thing? As in, you could use the slider if you wanted, or just press the play button.
Great question, and I'm not sure about this one. You can definitely have two different widgets going into the same function (for example, this post: stackoverflow.com/questions/66566606/python-ipywidgets-functions-that-links-multiple-widgets-in-different-functions) but you may need to switch to observe instead of interact. Perhaps you could write a function where both the play button and the slider feed into the same function and control the output? I haven't tried this myself, though, so just a guess.
Hi u didn't response to my query in LinkedIn.. Can u pls
Hi there - just catching up with LinkedIn. If I haven't replied yet - can you resend and mention this UA-cam channel? Cheers!
@@KimberlyFessel hi dear, yes i did. Hope to see more interesting content besides visualization