Skip to content

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

Closed as not planned

Description

@aburgm

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.

Activity

  1. aburgm commented on Mar 27, 2015

    @aburgm
    Author
  2. WeatherGod commented on Mar 27, 2015

    @WeatherGod
    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)
    .

  3. aburgm commented on Mar 27, 2015

    @aburgm
    Author

    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)

  4. aburgm commented on Mar 27, 2015

    @aburgm
    Author

    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.

  5. WeatherGod commented on Mar 27, 2015

    @WeatherGod
    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)
    .

  6. github-actions commented on Jun 5, 2023

    @github-actions

    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!

  7. added
    status: closed as inactiveIssues closed by the "Stale" Github Action. Please comment on any you think should still be open.
    on Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    GUI: nbaggstatus: closed as inactiveIssues closed by the "Stale" Github Action. Please comment on any you think should still be open.status: inactiveMarked by the “Stale” Github Actiontopic: animation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions