3

I am using VS 2013 Express version with python tools and canopy installed (python 2.7).

I am trying to plot a simple function when I run the code and it doesn't work:

import numpy as np
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab

plt.plot(np.random.rand(1000).cumsum())

I'm using interactive mode as IPython and when I execute the above in the command prompt, I see the plot.

The only difference between this plot on the cmd and in VS 2013 is the --pylab option I use when I load IPython on the commands prompt. When I tries to add --pylab and an Interpreter Options (Tools --> Setting --> Python Tools --> Interactive Windows).

anyone knows how I can get actual matplotlib plots when I run my python code on Visual Studio ?

Thanks for your help.

1 Answer 1

7

You need to type plt.show()

pylab mode makes this unnecessary.

http://matplotlib.org/faq/usage_faq.html#matplotlib-pyplot-and-pylab-how-are-they-related

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

Comments

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.