using different backends for python 2.7 and 3.6

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

using different backends for python 2.7 and 3.6

Slavin, Jonathan
Hi,

I'm starting to make the transition from python 2.7.x to python 3.x (currently 3.6).  I've found that for my python 3.6 installation (via conda), the Qt4Agg backend doesn't work, but Qt5Agg does.  On the other hand, for python 2.7, Qt4Agg works, but Qt5Agg doesn't.  Of course it would be best if these issues were fixed (and there appear to be bug reports on this) but until that happens, is there a recommended way to set the backend other than editing the matplotlibrc file.  I tried setting the MPLBACKEND environment variable, but that didn't seem to work. I like using ipython --pylab, especially for quick plotting. I know I could start ipython and then do
import matplotlib
matplotlib.use("Qt5Agg")
​etc., but that's kind of a pain.  Suggestions welcome.

Regards,
Jon​

--
________________________________________________________
Jonathan D. Slavin                 Harvard-Smithsonian CfA
[hidden email]       60 Garden Street, MS 83
phone: (617) 496-7981       Cambridge, MA 02138-1516
cell: (781) 363-0035             USA
________________________________________________________


_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: using different backends for python 2.7 and 3.6

Nathan Goldbaum
You could sniff the python version in your IPython startup file.

On Fri, May 5, 2017 at 10:03 AM, Slavin, Jonathan <[hidden email]> wrote:
Hi,

I'm starting to make the transition from python 2.7.x to python 3.x (currently 3.6).  I've found that for my python 3.6 installation (via conda), the Qt4Agg backend doesn't work, but Qt5Agg does.  On the other hand, for python 2.7, Qt4Agg works, but Qt5Agg doesn't.  Of course it would be best if these issues were fixed (and there appear to be bug reports on this) but until that happens, is there a recommended way to set the backend other than editing the matplotlibrc file.  I tried setting the MPLBACKEND environment variable, but that didn't seem to work. I like using ipython --pylab, especially for quick plotting. I know I could start ipython and then do
import matplotlib
matplotlib.use("Qt5Agg")
​etc., but that's kind of a pain.  Suggestions welcome.

Regards,
Jon​

--
________________________________________________________
Jonathan D. Slavin                 Harvard-Smithsonian CfA
[hidden email]       60 Garden Street, MS 83
phone: <a href="tel:(617)%20496-7981" value="+16174967981" target="_blank">(617) 496-7981       Cambridge, MA 02138-1516
cell: <a href="tel:(781)%20363-0035" value="+17813630035" target="_blank">(781) 363-0035             USA
________________________________________________________


_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users



_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Loading...