# simple_plot.py: Demostrate plot(), labeling, and graphing.

# A simple plotting example for 
# x vs. x^2

# Import numerical routines
from numpy import *
# Import plotting routines
from pylab import *

# Create data arrays to plot
#
# The number of points to plot
nPts = 30
# Independent coordinate
x = arange(0.,float(nPts),1.)
# Dependent coordinate
y = x * x

# Setup the plot
#
# Horizontal axis label
xlabel('X') # set x-axis label
# Vertical axis label
ylabel('X Squared') # set y-axis label
# Plot heading
title('X-squared versus X') # set plot title

# Now plot
plot(x, y, 'b') # make the plot

# Display the plot in a window
show()
