Change matplotlib's backend to GTK in conda env

0 views
Skip to first unread message

Xunius Xu

unread,
May 24, 2017, 10:46:41 AM5/24/17
to conda - Public
Hi everyone,

I wanted to try changing my matplotlib's backend from 'Qt5Agg' (default) to 'GTKAgg', or 'GTK'. I did this by modifying

```
~/anaconda2/envs/myenv/lib/python2.7/site-packages/matplotlib/mpl-data/matplotlibrc
```
Then matplotlib complains that `Gtk* backend requires pygtk to be installed.`, although I've installed it via `conda install -c ska pygtk` and reinstalled matplotlib afterwards.

There are some similar Q&As in stackoverflow but I didn't find one regarding conda environment, and I also tried reinstall matplotlib using `pip` and it didn't help.

Lastly, I wanted to change the default backend because currently in my i3-gaps WM the matplotlib figure windows have no title bar and I can't drag them around using mouse. ‘TkAgg' has failed too, it didn't even show any image at all.

Thanks in advance!
Guangzhi

无病毒。www.avast.com

Thomas Caswell

unread,
Jul 9, 2017, 5:08:56 PM7/9/17
to Xunius Xu, conda - Public

Re installing Matplotlib likely over wrote your changes to the default matplotlibrc file.  You should not have to re install Matplotlib to change the back end.

See https://matplotlib.org/faq/usage_faq.html#what-is-a-backend and the looks from there for how to change the back end with out editing the conda installed files.

Tom


--
You received this message because you are subscribed to the Google Groups "conda - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to conda+un...@continuum.io.
To post to this group, send email to co...@continuum.io.
Visit this group at https://groups.google.com/a/continuum.io/group/conda/.
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/conda/CAFV-3cRAfEEAKLqyEP1%2B%2BbfWdDWq3Y4g9qMenvS7C25dECtreg%40mail.gmail.com.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.
Reply all
Reply to author
Forward
0 new messages