Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Animation widgets for Pause/Rewind/etc. #20564

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
cslotboom opened this issue Jul 2, 2021 · 4 comments
Open

Animation widgets for Pause/Rewind/etc. #20564

cslotboom opened this issue Jul 2, 2021 · 4 comments

Comments

@cslotboom
Copy link

Problem

It would be useful if matplotlib had an animation class pre-programed with widgets, similar to the one on presented on the matplotlib website:
https://matplotlib.org/stable/gallery/animation/simple_anim.html#sphx-glr-gallery-animation-simple-anim-py
image

Nearly all the animations I'm working on would benefit greatly from the ability to pause/rewind/step forward/etc. as shown in the example - it was sad to see these features couldn't be implemented using the example code.
It would be possible to recreate these widgets, but the process is finicky and quite involved, definitely not something the average user could easily step into.

A pre-built animation with widgets class could take a lot of the hassle out of implementing some of these features.
Baring that, having an example that recreated the website widgets in python would also save a lot of troubleshooting.

@mikaeltulldahl
Copy link

mikaeltulldahl commented Nov 23, 2022

This could be a good starting point
https://stackoverflow.com/a/46327978/3949028
I have been improving this Player class for my own purpose, could share it when it is done. I also found some more bugs with animation class in the pause() & resume() methods which will need fixing too

@tacaswell
Copy link
Member

That is a good example (as is most things @ImportanceOfBeingErnest has writte).

In the docs we have pre-rendererd the full animation and the html UI is effective a movie player. Doing it on top of a live figure gets a bit more interesting because we have a lot more degrees of freedom!

The choice to parameterize the animation only by i is a reasonable simplification.

@timhoffm
Copy link
Member

I'm a bit sceptical that we're driving the widget thing too far. Yes, it basically works and has the advantage of being backend-independent. On the other hand, it has some serious limitations: non-native look&feel, layout issues (does this work with constrained layout?), resizing/scaling issues, non-accessibility, ...

Maybe we'd be better off by creating an animation widget for each of the GUI toolkits and provide that similar to the toolbar. - After all it's only a set of buttons and a slider, which should be quite easy to create.

@mikaeltulldahl
Copy link

It's up to matplotlib community to decide. I just realized that I was not alone looking for this functionality so I decided do share my work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants