You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
nbagg: Animation need "kick-off" when added from different notebook cell #4287
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.
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.
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)
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.
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.
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)
.
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!
Activity
aburgm commentedon Mar 27, 2015
Here's a notebook to reproduce: http://nbviewer.ipython.org/gist/aburgm/7ecac8c7835f4c5816b3
WeatherGod commentedon Mar 27, 2015
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:
aburgm commentedon Mar 27, 2015
Adding
plt.draw()at the end does not cause the animation to run.When the
%matplotlib nbaggmagic is active, there are noshow()ordraw()calls involved at all, and so, naively, I wouldn't expect to need one in this case. (I just removed the%matplotlib nbaggin this notebook to be as close as possible to the original example)aburgm commentedon 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 commentedon Mar 27, 2015
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:
github-actions commentedon 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!