I'm brand new to Python, and I was just plot a really simple graph in iPython Notebook.
import matplotlib.pyplot as plt
plt.plot([1,2,3,4])
plt.show()
This is what I wrote, expecting a simple graph of a diagonal line, but when I run it, nothing prints at all.
If I delete
plt.show()
I get this as output:
[<matplotlib.lines.Line2D at 0x109fcdb50>]
How do I get the plot to show?
I am also new to MatPlotLib but this sample got me a simple sin wave graph
The key was the call to
plt.draw()
the complete code is below.