numpy plotting code example

Example 1: how to plot a graph using matplotlib

from matplotlib import pyplot as plt
plt.plot([0, 1, 2, 3, 4, 5], [0, 1, 4, 9, 16, 25])
plt.show()

Example 2: plot function in numpy

import numpy as np 
from matplotlib import pyplot as plt 

x = np.arange(1,11) 
y = 2 * x + 5 
plt.title("Matplotlib demo") 
plt.xlabel("x axis caption") 
plt.ylabel("y axis caption") 
plt.plot(x,y) 
plt.show()

Example 3: pylab plotting data

pylab.plot(x, y)

pylab.xlabel('this is x!')
pylab.ylabel('this is y!')
pylab.title('My First Plot')