It would be better to import NumPy and Matplotlib, rather than Pylab to avoid confusion. The code might also benefit from being simplified a bit.