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
I've been thinking about this. Ultimately what we want is to redraw stale plots at the end of each "event burst" -- we never want to leave the plot in a stale render, and we also don't want to call draw() more than once during some sequence of state updates that are all within a single "user transaction" (an example of this is the user deleting 10 subsets in one click. We don't want to redraw every plot 10 times as each subset is removed)
It looks like MPL now claims to track when each plot is stale, which is cool if it's robust. So we should be able to remove all calls to draw() in our codebase, and attach a piece of code ...somewhere... to check for and redraw stale plots.
The thing I'm not sure about is where this should be. My vague understanding is that user events in Qt are queued up asynchronously, but Qt periodically processes events by synchronously running the python callbacks attached to each event. Ideally we'd attach a callback that runs at the end of this event loop step. I'm not sure how to do that, but it must be possible.
To support backwards compatibility with older MPL, we could replace all the current draw() calls to something that sets our own stale flag, and uses the same logic to refresh stale plots (ie instead of monkeypatching Canvas.draw within a context manager)
See matplotlib/matplotlib#4091
The text was updated successfully, but these errors were encountered: