Contents Previous Next Subchapters

Plotting A Stair Graph
Syntax gstair(y)     
gstair(
yx)
See Also gbar , ghist

Description
Plots a stair graph, where the integer, real, or double-precision column vector y specifies the height of the graph over each interval, and the column vector x specifies the interval limits and has one more row than y. If r is the row dimension of y, the value y(i) is plotted over the interval [x(i), x(i+1)] for i equal 1 to r. If x is not present, the value y(i) is plotted over the interval [i-.5, i+.5]. The vector x should be monotone increasing; that is, x(i< x(i+1) for all i.

Example
     gtitle("Stair Plot of x^2")
     y = seq(10)^2
     gstair(y)

returns the following plot: