|
Contents | Previous | Next | Subchapters |
| Syntax |
bar(y) |
bar(x, y) | |
| See Also | gbar , ghist , gstair |
m is the length of both the vectors y and x,
a bar of height y(i) is plotted centered over the horizontal location
x(i) for i equal 1 to m.
If x is not present,
the value y(i) is plotted over the horizontal location i.
The vector x must be
strictly monotone
increasing or decreasing.
clear
gtitle("Bar Plot of x^2")
x = seq(5)
y = x^2
bar(x, y)
returns the following plot: