Next: boxplot5num() Up: Graphics Macros Help File Previous: Graphics Macros Help File   Contents

# bargraph()

Usage:
 ```bargraph(edges,y [,save:T] [,draw:T] [,graphics keyword phrases]), REAL vectors edges and y, length(edges) <= 2 or = length(y) + 1 bargraph(vector(firstedge [,secondedge]), y, [,save:T] [,draw:T] ...), firstedge < secondedge REAL scalars, default for secondedge = firstedge + 1 bargraph(x,y,widths [,save:T] [,draw:T] ...), REAL vectors x, y with same length and width a positive vector of same length as x or a positive scalar, interpreted as rep(widths,nrows(x) ```

Keywords: bar graphs
```bargraph(edges, y [,graphics keyword phrases]) draws a bar graph with
touching bars and bar heights y.  Arguments edges and y are REAL vectors
with edges[j+1] - edges[j] > 0 and length(edges) = length(y) + 1.  Bar j
has height y[j] and boundaries edges[j] and edges[j+1].

The graphics keyword may include 'xlab', 'ylab', 'title', keywords
having to do with tick marks and so on.

bargraph(vector(edge1, edge2), y [,graphics keyword phrases]), where
edge1 < edge2 are REAL scalars does the same except the bar edges are
edge1, edge1 + width, ...,edge1 + length(y)*width, where width = edge1 -
edge1.

bargraph(edge1, y [, ...]) is the same a bargraph(vector(edge1,edge1+1),
y, ...).

bargraph(x, y, w [,...]) draws a bar graph with bars centered at x,
with heights y and widths w.  x, y and w must be REAL vectors with no
MISSING values and nrows(x) = nrows(y), and w vector of the same length
or a scalar equivalent to rep(w,nrows(x)).

bargraph(edges,y, keep:T [,draw:T] [,graphics keyword phrases]) or
bargraph(x,y,w, keep:T [,draw:T] [,graphics keyword phrases])
returns
structure(x:xvals, y:yvals [,graphics keyword phrases], lines:T)
where xvals and yvals are REAL vectors such that lineplot(xvals,yvals)
would draw the bars.  With draw:T, the graph also is drawn.

The structure can be assigned to GRAPHWINDOWS[j] to draw the bar graph
in window j or used with panelplot() to draw the bar graph in a panel
graph (see topics panelplot() and 'panel_graphs').