Support matplotlib's Gtk3 backend in --pylab mode#4640
Support matplotlib's Gtk3 backend in --pylab mode#4640takluyver merged 1 commit intoipython:masterfrom
Conversation
|
matplotlib/matplotlib#2646 is also required to prevent crashing on the matplotlib side. |
There was a problem hiding this comment.
This seems to be inline with the others, but I'm a bit confused about why the GUI to backend mapping has 'GTK3Agg', but the reverse mapping has GTK3Cairo.
There was a problem hiding this comment.
it's strictly in addition to those already in the forward mapping -
%matplotlib gtk3
implies backend=GTK3Agg
but
%matplotlib
when the backend is already either GTK3Agg or GTK3Cairo should behave the same in terms of eventloop integration.
There was a problem hiding this comment.
The forward mapping is used when a backend is specified on the IPython commandline (and possible elsewhere), eg.:
ipython --pylab=gtk
The backward mapping is used when the user chooses a backend in their matplotlibrc file (or some other matplotlib-based mechanism) and we need to choose the mainloop type to install in IPython to match it.
So there's a many to one mapping from matplotlib backends to IPython mainloop types.
Also, perhaps somewhat confusingly, there is a Gtk2 "Gtk" backend that uses gdk for drawing. Gdk is totally gone in Gtk3 (replaced with Cairo) so Gtk3 only has Gtk3Cairo and Gtk3Agg, whereas Gtk as Gtk (Gdk), GtkCairo and GtkAgg.
There was a problem hiding this comment.
@minrk: We replied at the same time. You said it better ;)
There was a problem hiding this comment.
Ah, I see. I'd missed that the reverse mapping is initialised with the reverse of the forwards mapping. This looks fine, then.
Support matplotlib's Gtk3 backend in --pylab mode
Support matplotlib's Gtk3 backend in --pylab mode
If you set the matplotlib backend to
Gtk3AggorGtk3Cairoinmatplotlibrcand then start upipython --pylab, no plots are shown.Fortunately, the hard bit of supporting a Gtk3 eventloop has already been done, it just needs the mapping so it knows to use it.