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
Missing axes and background when using Gtk3Agg backend and animations in a GtkNotebook #3758
Comments
Try setting blit=False. If that works, then I suspect something is wonky Cheers! On Wed, Nov 5, 2014 at 11:48 AM, Timo notifications@github.com wrote:
|
Thanks, blit=False works indeed. Problem is I have 12 subplots in my application and the CPU usage is a lot higher this way. I can connect to the GTK Do other backends have the same issue or is something missing in the GTK backend? |
Blitting is a bit of black-magic as it involves reaching in and touching the pixel buffer being used to draw the GUI to the screen and can be a tad brittle. I suspect what is going on here is that the blit caches are not getting invalidated/recreated correctly, but being should would involve tracing through your gui + the animation code. Have a look at the code in 'Animation._handle_resize`, my guess is you need to do something like that. |
Can you register a call back with gtk to fire on tab-switch to force a full-redraw of the canvas? A quick test if this will work is if you re-size the window after you switch tabs if the plots fix them selves. |
Yes, GTK has a map signal which is emitted when a widget is visible. Adding the following lines fixes the problem, but not very reliably. def on_map(widget):
widget.draw_idle()
canvas.connect("map", on_map) This particular example only works with |
I am a bit confused why you need to use You might also want to push any computation you are doing off to a second thread to make sure the event loop is idle often enough. @timovwb I am going to close this issue as it isn't clear to me if there is a bug in mpl. The user mailing list might be a better place to continue this discussion as it has a wider audience. If you disagree, ping me. |
I have multiple notebook tabs in my application where one holds a matplotlib graph made with the Gtk3Agg backend. It has multiple subplots which are animated with the builtin functions. Switching to the tab with the graph for the first time is not a problem, but there are missing axes when going back.
Here's a modified example from the website which illustrates the problem.
The text was updated successfully, but these errors were encountered: