Draw a Cleveland dot plot.
dotchart(x, labels = NULL, groups = NULL, gdata = NULL, cex = par("cex"), pt.cex = cex, pch = 21, gpch = 21, bg = par("bg"), color = par("fg"), gcolor = par("fg"), lcolor = "gray", xlim = range(x[is.finite(x)]), main = NULL, xlab = NULL, ylab = NULL, …)
a vector of labels for each point.
For vectors the default is to use
names(x) and for matrices
the row labels
an optional factor indicating how the elements of
x are grouped.
x is a matrix,
groups will default to the columns
data values for the groups. This is typically a summary such as the median or mean of each group.
the character size to be used. Setting
to a value smaller than one can be a useful way of avoiding label
overlap. Unlike many other graphics functions, this sets the actual
size, not a multiple of
cex to be applied to plotting symbols.
This behaves like
the plotting character or symbol to be used.
the plotting character or symbol to be used for group values.
the background color of plotting characters or symbols to be
par(bg= *) to set the background color of
the whole plot.
the color(s) to be used for points and labels.
the single color to be used for group labels and values.
the color(s) to be used for the horizontal lines.
horizontal range for the plot, see
plot.window, for example.
overall title for the plot, see
axis annotations as in
graphical parameters can also be specified as arguments.
This function is invoked for its side effect, which is to produce two variants of dotplots as described in Cleveland (1985).
Dot plots are a reasonable substitute for bar plots.
Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) The New S Language. Wadsworth & Brooks/Cole.
Cleveland, W. S. (1985) The Elements of Graphing Data. Monterey, CA: Wadsworth.
Murrell, P. (2005) R Graphics. Chapman & Hall/CRC Press.