2

I would like to manually set the matplotlib backend in Anaconda Spyder using the following commands:

import matplotlib matplotlib.use('qt5agg') 

However when I try, I get the following warning, and I can verify that I did not successfully set the backend.

>import matplotlib >matplotlib.use('qt5agg') /home/selah/anaconda3/lib/python3.6/site-packages/matplotlib/__init__.py:1405: UserWarning: This call to matplotlib.use() has no effect because the backend has already been chosen; matplotlib.use() must be called *before* pylab, matplotlib.pyplot, or matplotlib.backends is imported for the first time. warnings.warn(_use_error_msg) 

If I run ipython from the command line without using Anaconda I can set the backend successfully.

I need to specify the backend in order to successfully run %matplotlib qt

2
  • 2
    Have you tried setting the backend via Spyder's menu option? (Perhaps you can set it to qt5agg (instead of automatic) there.) Commented Aug 11, 2017 at 18:40
  • I had not. I can now generate interactive plots. Thanks!! Commented Aug 11, 2017 at 20:14

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.