Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spyder opening/closing matplotlib window problem #4272

Closed
ChrisBail opened this issue Mar 17, 2017 · 10 comments
Closed

Spyder opening/closing matplotlib window problem #4272

ChrisBail opened this issue Mar 17, 2017 · 10 comments

Comments

@ChrisBail
Copy link

Description of your problem

What steps will reproduce the problem?

I'm using the python library obspy. They have a class method to plot signal, which is class_name.plot(). When running it under Spyder, the window pops up really quickly then disappears. When running it in "inline" mode there is no problem of display. Moreover when in "automatic" mode (tools>preferences>python) when running a classical matplotlib.pyplot.show() it has no problem of showing the figure in a new window

What is the expected output? What do you see instead?

class_name.plot() should give an interactive plot

Please provide any additional information below

Versions and main components

  • Spyder Version:3.1.3
  • Python Version:2.7.12
  • Qt Version:4.8.7
  • PyQt Version:4.11.4
  • Operating system: xubuntu 16.04

Dependencies

Please go to the menu entry Help > Optional Dependencies (or
Help > Dependencies), press the button Copy to clipboard
and paste the contents below:

jedi =0.9.0 : 0.9.0 (OK)
matplotlib >=1.0 : 1.5.3 (OK)
nbconvert >=4.0 : 5.1.1 (OK)
numpy >=1.7 : 1.12.0 (OK)
pandas >=0.13.1 : None (NOK)
pep8 >=0.6 : 1.7.0 (OK)
psutil >=0.3 : 5.1.3 (OK)
pyflakes >=0.5.0 : 1.5.0 (OK)
pygments >=2.0 : 2.2.0 (OK)
pylint >=0.25 : 1.6.4 (OK)
qtconsole >=4.2.0: 4.2.1 (OK)
rope >=0.9.4 : 0.9.4 (OK)
sphinx >=0.6.6 : 1.5.2 (OK)
sympy >=0.7.3 : None (NOK)

@ccordoba12
Copy link
Member

ccordoba12 commented Mar 17, 2017

This is (probably) a duplicate of issue #4002. What happens if you run twice (before plotting for the first time with the inline backend)

%matplotlib qt5

?

@ChrisBail
Copy link
Author

running %matplotlib qt5 I get:
Warning: Cannot change to a different GUI toolkit: qt5. Using qt instead.

@ccordoba12
Copy link
Member

Sorry, I didn't see you're using Qt4. Then what happens if you run twice

%matplotlib qt

?

@ChrisBail
Copy link
Author

Still the same, the windows pops up quickly then shuts down.

@ccordoba12
Copy link
Member

Please post a complete and simple code that generates this problem, so we can test and debug it in our side.

@ChrisBail
Copy link
Author

#!/usr/bin/env python2

from obspy import read
st=read()
st.plot()

@ccordoba12
Copy link
Member

What does read do?

@ChrisBail
Copy link
Author

read reads a signal from a URL, for example:

st = read('http://examples.obspy.org/RJOB_061005_072159.ehz.new')
print(st)
1 Trace(s) in Stream:
.RJOB..Z | 2005-10-06T07:21:59.849998Z - 2005-10-06T07:24:59.844998Z | 200.0 Hz, 36000 samples

Without any argument it will just read and plot some inside example

@ccordoba12 ccordoba12 removed this from the v3.2 milestone Apr 26, 2017
@ccordoba12
Copy link
Member

This was fixed in 3.1.4, please update.

@gisofer
Copy link

gisofer commented May 29, 2018

Hi, I am having the same problem.
Is there a way to fix it?

Spyder Version: 3.2.3
Python Version: 2.7.13 64 bits
Qt Version: 5.6.2
PyQt5 Version: 5.6
Operating system: Windows 10 Pro

IPython >=4.0;<6.0: 5.4.1 (OK)
cython >=0.21 : 0.26.1 (OK)
jedi >=0.9.0 : 0.10.2 (OK)
nbconvert >=4.0 : 5.3.1 (OK)
numpy >=1.7 : 1.11.3 (OK)
pandas >=0.13.1 : 0.20.3 (OK)
pycodestyle >=2.3 : 2.3.1 (OK)
pyflakes >=0.5.0 : 1.5.0 (OK)
pygments >=2.0 : 2.2.0 (OK)
pylint >=0.25 : 1.7.2 (OK)
qtconsole >=4.2.0 : 4.3.1 (OK)
rope >=0.9.4 : 0.10.5 (OK)
sphinx >=0.6.6 : 1.6.3 (OK)
sympy >=0.7.3 : 1.1.1 (OK)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants