1

I had everything set up and working a few months ago - Spyderxy; matplotlib; numpy and all that... Today I went to open up spyder but it wasn't working so I uninstalled and reinstalled.

I installed 2.7

I then installed numpy/matplotlib as well. But now I'm having a problem - my old code doesn't work. Normally I could write -

from matplotlib import *
xdata = [1, 2]
ydata = [3, 4]
plot(xdata, ydata)

And it'd work fine. But now the only way I can get it to graph anything is if I type -

import matplotlib.pyplot as plt
x = [1, 2]
y = [2, 3]
plt.plot(x, y)
plt.show()

Any ideas on how to get it back to normal? I'm on the verge of tearing out my hair.

Cheers

Oh not sure if this is relevant but it is freezing all the time now too.

3
  • Do you know which version of matpltotlib you had and which you now have? Have you installed anything else such as Scientific python or SciPy? Commented Mar 14, 2012 at 13:33
  • Sounds as though you had interactive mode on previously, somehow. Try using plt.ion() Commented Mar 14, 2012 at 13:36
  • It works!!! Nothing can contain my excitement! I have no idea what changed it, but thanks to you guys for being so quick to offer help. I uninstalled pythonxy and reinstalled it. Sort of weird because I had done that just 30 minutes earlier which seemed to cause all the problems. Commented Mar 14, 2012 at 13:59

1 Answer 1

1

Your matplotlib configuration is not set to have interactive mode enabled for your script environment. The ion()/ioff() function of matplotlib indicate whether the plots are automatically or manually updated.

Sign up to request clarification or add additional context in comments.

1 Comment

Find your matplotlibrc file (usually in your home directory) and modify the line "interactive : False" to "interactive : True". By default Matplotlib should start in interactive mode. You can use ioff()/ion() to disable/enable this in the shell itself.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.