Wednesday, May 8, 2013

PL#1: Line and scatter plot



from pylab import *
x=arange(0,10,0.03)
seed(123)
y= 0.6 * x + np.random.rand(len(x))
plot(x,y) # plot with default line and color
xlabel('x-axis')
ylabel('y-axis')
title(r'my plot')
show()




from pylab import *
x=arange(0,10,0.03)
y= 0.6 * x + np.random.rand(len(x))
plot(x,y, ".") # plot with default line and color
xlabel('x-axis')
ylabel('y-axis')
title(r'my plot')
show()


subplot(12)


x=arange(0,10,0.03)
seed(123)
y= 0.6 * x + np.random.rand(len(x))
plot(x,y, "ro") # red circle
xlabel('x-axis')
ylabel('y-axis')
title(r'my plot')
show()







No comments:

Post a Comment