%matplolib magic command in IPython terminal needs to be executed twice to actually work.
What steps will reproduce the problem?
In [1]: import matplotlib.pyplot as plt
In [2]: plt.plot([1,2,3])
Out[2]: [<matplotlib.lines.Line2D at 0x21347b252b0>]
GRAPH INLINE
In [3]: %matplotlib
Using matplotlib backend: Qt5Agg
In [4]: plt.plot([1,2,3])
Out[4]: [<matplotlib.lines.Line2D at 0x21349bf2438>]
GRAPH INLINE
In [5]: %matplotlib
Using matplotlib backend: Qt5Agg
In [6]: plt.plot([1,2,3])
Out[6]: [<matplotlib.lines.Line2D at 0x21349c5cf98>]
GRAPH IN EXTERNAL WINDOW
What is the expected output? What do you see instead?
Only one %matplolib call should be enough.
Please provide any additional information below
jedi >=0.8.1 : 0.9.0 (OK)
matplotlib >=1.0 : 1.5.3 (OK)
nbconvert >=4.0 : 4.2.0 (OK)
numpy >=1.7 : 1.11.3 (OK)
pandas >=0.13.1 : 0.19.2 (OK)
pep8 >=0.6 : 1.7.0 (OK)
pyflakes >=0.6.0 : 1.5.0 (OK)
pygments >=2.0 : 2.1.3 (OK)
pylint >=0.25 : 1.6.4 (OK)
qtconsole >=4.2.0: 4.2.1 (OK)
rope >=0.9.4 : 0.9.4-1 (OK)
sphinx >=0.6.6 : 1.5.1 (OK)
sympy >=0.7.3 : None (NOK)
This is because we internally run
%matplotlib inline
when we start all our kernels by default. Your second command should be
%matplotlib qt5
if you want to use Qt5 directly.
I think I didn't explain it well. The problem is that after the first %matplotlib the graph should appear in an external window and it doesn't. It does only after a second %matplotlib.
If you want to see your plot in a external window for sure, you need to use the command I gave you, i.e.
%matplotlib qt5
not just
%matplotlib
because %matplotlib with no args is used to set the default backend, not to change between inline and external.
I just tried and I get the same behavior than without args.
Actually with or without args I can see a window during an instant, but it disappears immediately and then it is plotted inline again. A second call fixes it.
PD: in Spyder 2 %matplotlib without args was working.
That's certainly odd, we take a look at it :-)
@mariacamilaremolinagutierrez, please work on this one.
@ccordoba12 @rubennj I am not able to reproduce this error. When I run %matplotlib qt5 I get the external window right away without second calls:

I however just updated qt and pyqt. Ruben could you please update to our latest release (https://github.com/spyder-ide/spyder/releases/tag/v3.1.1) and tell me if this problem remains?
@ccordoba12 to ease issue reporting we might also query for (is a anaconda install and provide the conda info and conda list on the report? of deps?)
@goanpeca, yep, sounds good!
In the way @mariacamilaremolinagutierrez has tested it also works on my system (not plotting inline first). But it does not work as I showed. This is a more typical situation. First you check some data and later you can be interested in a more dynamic view, like a zoom, for example.
I'm waiting for Continuum repositories to update Spyder to 3.1.1.
Below my current conda list:
_nb_ext_conf 0.3.0 py35_0
alabaster 0.7.9 py35_0
anaconda-client 1.6.0 py35_0
astroid 1.4.9 py35_0
autopep8 1.2.4
babel 2.3.4 py35_0
bzip2 1.0.6 vc14_3 [vc14]
cffi 1.9.1 py35_0
chardet 2.3.0 py35_0
clyent 1.2.2 py35_0
colorama 0.3.7 py35_0
conda 4.3.7 py35_0
conda-env 2.6.0 0
console_shortcut 0.1.1 py35_1
cryptography 1.7.1 py35_0
cycler 0.10.0 py35_0
decorator 4.0.11 py35_0
docutils 0.13.1 py35_0
entrypoints 0.2.2 py35_0
freetype 2.5.5 vc14_2 [vc14]
icu 57.1 vc14_0 [vc14]
idna 2.2 py35_0
imagesize 0.7.1 py35_0
ipykernel 4.5.2 py35_0
ipython 5.1.0 py35_0
ipython_genutils 0.1.0 py35_0
ipywidgets 5.2.2 py35_1
jedi 0.9.0 py35_1
jinja2 2.9.4 py35_0
jpeg 9b vc14_0 [vc14]
jsonschema 2.5.1 py35_0
jupyter 1.0.0 py35_3
jupyter_client 4.4.0 py35_0
jupyter_console 5.0.0 py35_0
jupyter_core 4.2.1 py35_0
lazy-object-proxy 1.2.2 py35_0
libpng 1.6.27 vc14_0 [vc14]
libtiff 4.0.6 vc14_3 [vc14]
markupsafe 0.23 py35_2
matplotlib 1.5.3 np111py35_1
menuinst 1.4.3 py35_0
mistune 0.7.3 py35_0
mkl 2017.0.1 0
nb_anacondacloud 1.2.0 py35_0
nb_conda 2.0.0 py35_0
nb_conda_kernels 2.0.0 py35_0
nbconvert 4.2.0 py35_0
nbformat 4.2.0 py35_0
nbpresent 3.0.2 py35_0
notebook 4.3.1 py35_1
numexpr 2.6.1 np111py35_2
numpy 1.11.3 py35_0
numpydoc 0.6.0 py35_0
openssl 1.0.2j vc14_0 [vc14]
pandas 0.19.2 np111py35_1
path.py 10.0 py35_0
patsy 0.4.1 py35_0
pep8 1.7.0 py35_0
pickleshare 0.7.4 py35_0
pillow 4.0.0 py35_0
pip 9.0.1 py35_1
prompt_toolkit 1.0.9 py35_0
psutil 5.0.1 py35_0
pyasn1 0.1.9 py35_0
pycosat 0.6.1 py35_1
pycparser 2.17 py35_0
pycrypto 2.6.1 py35_5
pyflakes 1.5.0 py35_0
pygments 2.1.3 py35_0
pylint 1.6.4 py35_0
pyopenssl 16.2.0 py35_0
pyparsing 2.1.4 py35_0
pyqt 5.6.0 py35_2
python 3.5.2 0
python-dateutil 2.6.0 py35_0
pytz 2016.10 py35_0
pywin32 220 py35_2
pyyaml 3.12 py35_0
pyzmq 16.0.2 py35_0
qt 5.6.2 vc14_3 [vc14]
qtawesome 0.4.1 py35_0
qtconsole 4.2.1 py35_2
qtpy 1.2.0 py35_0
requests 2.12.4 py35_0
rope 0.9.4 py35_1
ruamel_yaml 0.11.14 py35_1
scikit-learn 0.18.1 np111py35_1
scipy 0.18.1 np111py35_1
setuptools 27.2.0 py35_1
simplegeneric 0.8.1 py35_1
sip 4.18 py35_0
six 1.10.0 py35_0
snowballstemmer 1.2.1 py35_0
sphinx 1.5.1 py35_0
spyder 3.1.0 py35_0
statsmodels 0.6.1 np111py35_1
tk 8.5.18 vc14_0 [vc14]
tornado 4.4.2 py35_0
traitlets 4.3.1 py35_0
vs2015_runtime 14.0.25123 0
wcwidth 0.1.7 py35_0
wheel 0.29.0 py35_0
widgetsnbextension 1.2.6 py35_0
win_unicode_console 0.5 py35_0
wrapt 1.10.8 py35_0
xlrd 1.0.0 py35_0
zlib 1.2.8 vc14_3 [vc14]
I got Spyder 3.1.2 and still the same