There should be a way to use different config files for different python versions, or at least specify different backends for different versions. I have PyQt5 installed for python3, so I prefer to set my backend to Qt5Agg. But occasionally I want to run something in python2 for testing or compatibility purposes. I don't want to waste time and space installing PyQt5 on python2, so I want the backend to stay TkAgg. A workaround is to change the config files in the matplotlib installation, but these will be overwritten on the next install.
I'm on windows (I could accomplish the same with a bash script) but I would much rather avoid using aliases if possible. By the time I remember I forgot to use the alias I might as well just call mpl.use('TkAgg').
Activity
QuLogic commented on Feb 4, 2018
You could use the MPLBACKEND environment variable to do that, e.g., if you're using bash, then alias pympl2='MPLBACKEND=TkAgg python2' could work.
rmccampbell commented on Feb 4, 2018
I'm on windows (I could accomplish the same with a bash script) but I would much rather avoid using aliases if possible. By the time I remember I forgot to use the alias I might as well just call mpl.use('TkAgg').
tacaswell commented on Feb 4, 2018
This would fit with in @anntzer 's advocacy to have the configuration just be a python script.
With our current system this would be a pretty big jump in complexity.
anntzer commented on Feb 5, 2018
timhoffm commented on Jul 16, 2020
The original use-case has become obsolete due to dropping of Python 2 support. Please reopen if this is still a desirable feature.