In [1]:
from pylab import *

In [2]:
x = linspace(0, 5, 10)
y = x ** 2

In [3]:
x


Out[3]:
array([ 0.        ,  0.55555556,  1.11111111,  1.66666667,  2.22222222,
        2.77777778,  3.33333333,  3.88888889,  4.44444444,  5.        ])

In [4]:
fig = plt.figure()

In [6]:
%pylab inline


Populating the interactive namespace from numpy and matplotlib
WARNING: pylab import has clobbered these variables: ['axes', 'linalg', 'draw_if_interactive', 'random', 'power', 'info', 'fft']
`%pylab --no-import-all` prevents importing * from pylab and numpy

In [9]:
axes = fig.add_axes([0,10,-1.5,1.5])
axes.plot(x,y,'r')


Out[9]:
[<matplotlib.lines.Line2D at 0x7f62738911d0>]

In [10]:
plt.show()

In [ ]: