-
Notifications
You must be signed in to change notification settings - Fork 19
Fix/animation noise #494
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
base: main
Are you sure you want to change the base?
Fix/animation noise #494
Conversation
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.
beckermr
left a comment
There was a problem hiding this 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?
|
Well we would have to replace how the layout is drawn -- I believe the issue is coming from the fact that ultraplot does a lot of layout correction on draw which causes an issue with FuncAnimation. Another option would be to provide a |
|
I see. The less patching we do, the better. I think given the nature of the fix, we should try and solve this cleanly with the new layout handling. |
This PR adds an
animation.force_draw_idlercParam (default on) and uses it to gate a targeted FuncAnimation hook that swapsdraw_idleto full draws on interactive canvases, reducing backend redraw artifacts without affecting headless renders, while keeping the earlier layout convergence work intactCloses #488
Drafting for now as I am not happy with it yet.