Skip to content

nbagg: Animation need "kick-off" when added from different notebook cell #4287

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

Closed
aburgm opened this issue Mar 27, 2015 · 6 comments
Closed
Labels
GUI: nbagg status: closed as inactive Issues closed by the "Stale" Github Action. Please comment on any you think should still be open. status: inactive Marked by the “Stale” Github Action topic: animation

Comments

@aburgm
Copy link

aburgm commented Mar 27, 2015

When a figure is created in one notebook cell and shown by the nbagg backend, and then an animation is added in the next one, the animation does not start in the figure until it is "kicked off" by somehow interacting with the nbagg widget, for example starting to pan or zoom around.

I'm using matplotlib 1.4.3 with #4171 cherry-picked.

@aburgm
Copy link
Author

aburgm commented Mar 27, 2015

Here's a notebook to reproduce: http://nbviewer.ipython.org/gist/aburgm/7ecac8c7835f4c5816b3

@WeatherGod
Copy link
Member

In general, the animation objects are set up to trigger at the next call to
draw(). I haven't tried your notebook, but I bet adding a draw() call for
the original figure object after creating the animation would do the trick.

On Fri, Mar 27, 2015 at 3:43 PM, Armin Burgmeier notifications@github.com
wrote:

Here's a notebook to reproduce:
http://nbviewer.ipython.org/gist/aburgm/7ecac8c7835f4c5816b3


Reply to this email directly or view it on GitHub
#4287 (comment)
.

@aburgm
Copy link
Author

aburgm commented Mar 27, 2015

Adding plt.draw() at the end does not cause the animation to run.

When the %matplotlib nbagg magic is active, there are no show() or draw() calls involved at all, and so, naively, I wouldn't expect to need one in this case. (I just removed the %matplotlib nbagg in this notebook to be as close as possible to the original example)

@aburgm
Copy link
Author

aburgm commented Mar 27, 2015

Also, in case it's helpful to someone: When I create the animation object as the last statement in the same cell in which the figure is created, it starts up, even if it's after the plt.show(). Only when it is run from the next cell it doesn't start off.

@WeatherGod
Copy link
Member

Right, I am not saying that you have to normally do the show() or the
draw(). In the nbagg backend, those things tend to be done automatically
for you. Somehow, the figure's "draw" event is not firing back to this
animation object. This might be a scope issue in the javascript.

On Fri, Mar 27, 2015 at 4:00 PM, Armin Burgmeier notifications@github.com
wrote:

Also, in case it's helpful to someone: When I create the animation object
as the last statement in the same cell in which the figure is created, it
starts up, even if it's after the plt.show(). Only when it is run from
the next cell it doesn't start off.


Reply to this email directly or view it on GitHub
#4287 (comment)
.

@github-actions
Copy link

github-actions bot commented Jun 5, 2023

This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!

@github-actions github-actions bot added the status: inactive Marked by the “Stale” Github Action label Jun 5, 2023
@github-actions github-actions bot added the status: closed as inactive Issues closed by the "Stale" Github Action. Please comment on any you think should still be open. label Jul 5, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GUI: nbagg status: closed as inactive Issues closed by the "Stale" Github Action. Please comment on any you think should still be open. status: inactive Marked by the “Stale” Github Action topic: animation
Projects
None yet
Development

No branches or pull requests

3 participants