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

Odd behaviour once I add a matplotlib command into a python program #2967

Closed
wpfan1000 opened this issue Feb 3, 2016 · 9 comments
Closed

Comments

@wpfan1000
Copy link

Hi,

Once I add matplotlib command to a program, and run that program once, succesfully, then Spyder:

  • Does not run program when Run file is pressed again - I just see ">>> runfile" with the path to the file...
  • If I click Run file several times, the program runs BUT it is NOT the code in the editor, it is code that existed before some recent changes
  • Does not save program

I press Exit Debug to try and resolve this - pressing this multiple times sometimes results in the program running multiple times.

Also this odd behaviour seems to change - ie there is no consistent bad behaviour, so sorry if my description is not clear.

The only way I have found to resolve this is to completely exit and re-start Spyder.

Please help.

@ccordoba12
Copy link
Member

Questions:

  1. Spyder version?
  2. Python version?
  3. Operating system?

@wpfan1000
Copy link
Author

Sorry, I should have included that in my OP:

Python 3.5.1 |Anaconda 2.4.1 (64-bit)| (default, Dec 7 2015, 15:00:12)
[MSC v.1900 64 bit (AMD64)] on win32

Spyder 2.3.8

Windows 7 64 bit

Thanks

On 03/02/2016 10:56 AM, Carlos Cordoba wrote:

Questions:

  1. Spyder version?
  2. Python version?
  3. Operating system?


Reply to this email directly or view it on GitHub
#2967 (comment).

@wpfan1000
Copy link
Author

I thought I would try and write a simple program to eliminate issues due to my complex code.
Even this code causes the issue:

import pandas
import matplotlib.pyplot as plt


# Read Yahoo data csv file into dataframe:
symbol_historical_data_frame = pandas.read_csv('symbol_historical_data_frame.csv')


# Debug:
# print (symbol_historical_data_frame)

symbol_historical_data_frame[['Open','High','Low','Close']].plot()
plt.show()

Please please help

@ccordoba12
Copy link
Member

I forgot to ask: what's your Matplotlib backend?

@ccordoba12
Copy link
Member

In the mean time you can use the IPython console, which doesn't have this problem.

@wpfan1000
Copy link
Author

HI, thanks for your response.
I do not know what a backend is and so I googled it - I see a lot of info about how to set it like
http://matplotlib.org/faq/usage_faq.html#what-is-a-backend
but I do not see how to get the current backend...
Could you explain how to do that?
Thanks

@wpfan1000
Copy link
Author

I switched to the IPython console as you recommended and it does work consistently - thanks.
However my plot is now shown inside the console as quite a small image - in Spyder the plot was rendedered in a separate window so I can see it full screen - is there a way to do that in IPython console?

@ccordoba12
Copy link
Member

You need to change your backend in

Preferences > IPython Console > Graphics

from Inlne to Automatic

@ccordoba12
Copy link
Member

This is almost a duplicate of issue #1831, so I'm closing it.

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

2 participants