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

Selah
  • 7,728
  • 9
  • 48
  • 60
  • 2
    Have you tried [setting the backend via Spyder's menu option](https://stackoverflow.com/a/31488324/190597)? (Perhaps you can set it to `qt5agg` (instead of `automatic`) there.) – unutbu Aug 11 '17 at 18:40
  • I had not. I can now generate interactive plots. Thanks!! – Selah Aug 11 '17 at 20:14

0 Answers0