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
  • Наука та технологія

КОМЕНТАРІ • 21

  • @jdsahr
    @jdsahr Рік тому

    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

  • @rskura
    @rskura 3 роки тому +1

    Fun stuff! Animations like this would be awesome for teaching.

    • @KimberlyFessel
      @KimberlyFessel  2 роки тому +1

      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.

  • @vitorribeirosa
    @vitorribeirosa Рік тому

    Neat!!!
    Thank you very much for your video.
    Cheers!!!

  • @fisica-oprometeu895
    @fisica-oprometeu895 2 місяці тому

    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.

    • @KimberlyFessel
      @KimberlyFessel  2 місяці тому

      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.

  • @mohammedkastali7096
    @mohammedkastali7096 2 роки тому

    thanks a lot

  • @farhodomonov
    @farhodomonov 4 місяці тому

    thank you

  • @s.mohammadmousavi4684
    @s.mohammadmousavi4684 3 роки тому

    Great explanation as always, I was wondering why don't you use Jupyter lab?

    • @KimberlyFessel
      @KimberlyFessel  2 роки тому +1

      Thank you! I really just haven't tried JupyterLab yet - it looks cool!

  • @adityams1659
    @adityams1659 2 роки тому

    How do i increment in float value for play widget??

  • @makisJacob
    @makisJacob 3 роки тому

    Very interesting! I was wondering if we can insert python widgets to ppt presentation. That would be very helpful!

    • @KimberlyFessel
      @KimberlyFessel  2 роки тому +2

      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!

    • @findthetruth3021
      @findthetruth3021 2 роки тому

      @@KimberlyFessel yes please

  • @elsabecker371
    @elsabecker371 2 роки тому

    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

  • @joshuaknicely2207
    @joshuaknicely2207 5 місяців тому

    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.

    • @KimberlyFessel
      @KimberlyFessel  5 місяців тому

      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.

  • @mohammed_Ansar
    @mohammed_Ansar 3 роки тому

    Hi u didn't response to my query in LinkedIn.. Can u pls

    • @KimberlyFessel
      @KimberlyFessel  2 роки тому

      Hi there - just catching up with LinkedIn. If I haven't replied yet - can you resend and mention this UA-cam channel? Cheers!

    • @mohammed_Ansar
      @mohammed_Ansar 2 роки тому

      @@KimberlyFessel hi dear, yes i did. Hope to see more interesting content besides visualization