Skip to content

Conversation

@cvanelteren
Copy link
Collaborator

This PR adds an animation.force_draw_idle rcParam (default on) and uses it to gate a targeted FuncAnimation hook that swaps draw_idle to full draws on interactive canvases, reducing backend redraw artifacts without affecting headless renders, while keeping the earlier layout convergence work intact

Closes #488

Drafting for now as I am not happy with it yet.

This commit addresses two issues related to :
1.  Noise and streaking artifacts in animations due to unconditional  calls on every draw.
2.  A  caused by the  keyword argument being passed to Matplotlib internals.

The following changes have been made:
- A  flag has been introduced in the  class to control when  is called.
-  is now only called when the figure's layout is dirty, preventing unnecessary recalculations during animations.
- The  method in  now only resizes the figure if the new size is different, preventing small oscillations.
- The  keyword argument is now popped in  to prevent it from being passed to Matplotlib.
@cvanelteren cvanelteren marked this pull request as ready for review January 22, 2026 10:35
Copy link
Collaborator

@beckermr beckermr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Monkey patching is very fragile. Is there a cleaner way to do this?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Points to note when creating animations using ultraplot

3 participants