Stairstep graph
stairs(y) stairs(x,y)
a matrix of doubles
a matrix of doubles
stairs(y)
plots the stairstep graph of y.
If y is a vector, the x-axis ranges from 1 to length(y).
If y is a matrix, the x-axis ranges from 1 to the number of rows in y. The number of columns in y is the number of stairstep graphs to plot.
stairs(x,y)
plots the stairstep graph of x and y.
// stairs(y), y a row vector x = linspace(0,4*%pi,40); y = sin(x); scf(); stairs(y) // stairs(y), y a matrix // Plot several stairstep graphs x = linspace(0,4*%pi,50)'; y = [0.5*cos(x), 2*cos(x)]; scf(); stairs(y); // stairs(x,y) x = linspace(0,4*%pi,40); y = sin(x); scf(); stairs(x,y) // Plot the empirical CDF of exponential // random numbers n=10000; y=1:n; y=y/n; lambda=1; x=gsort(rexpweib(n,lambda),"g","i"); scf(); stairs(x,y); | ![]() | ![]() |