0

I've been trying to make a scatter plot with the following code

import matplotlib
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(111)
ax.scatter(x, y)
plt.show()

If I type these commands line by line into ipython console, there is no graph displayed after the plt.show() command. However, if I copy and paste the whole code block into the console, the graph is displayed.

Has anyone had this issue before? What could be the reason for this?

Scott Robinson
  • 583
  • 1
  • 7
  • 23
xyin
  • 417
  • 2
  • 7
  • 19
  • 1
    @kvorobiev Nothing, not even a blank frame. x and y are two arrays of float type numbers defined somewhere else. – xyin Jul 13 '15 at 17:04
  • See [this question](http://stackoverflow.com/questions/7534453/matplotlib-does-not-show-my-drawings-although-i-call-pyplot-show). – Ami Tavory Jul 13 '15 at 19:19

0 Answers0