[Matplotlib-users] using different backends for python 2.7 and 3.6

Nathan Goldbaum nathan12343 at gmail.com
Fri May 5 11:10:02 EDT 2017


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

On Fri, May 5, 2017 at 10:03 AM, Slavin, Jonathan <jslavin at cfa.harvard.edu>
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
> jslavin at cfa.harvard.edu       60 Garden Street, MS 83
> phone: (617) 496-7981       Cambridge, MA 02138-1516
> cell: (781) 363-0035             USA
> ________________________________________________________
>
>
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users at python.org
> https://mail.python.org/mailman/listinfo/matplotlib-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20170505/6aff1943/attachment.html>


More information about the Matplotlib-users mailing list