Function to create a dot plot
dotPlot creates a dot plot. For data in groups the dotPlot is displayed stacked in one or not-stacked in different plot regions.
dotPlot(x, group, xlim, ylim, col, xlab, ylab, pch, cex, breaks, stacked = TRUE, ...)
vector with numeric values which should be plotted.
(optional) vector for grouping the values (see examples).
vector giving the lower and upper limit of the x-axis.
vector giving the lower and upper limit of the y-axis.
vector containing numeric values or strings for different colors for the groups in the dot plot.
a title for the x axis:
a title for the y axis:
a vector of integers specifying symbols or a single character to be used for plotting points for the different groups in the dot plot.
the amount by which points and symbols should be magnified relative to the default.
a vector giving the breakpoints for the binning of the values in x.
a logical vector specifying whether the single groups should be plotted in a stacked dot plot or in a single one.
stacked is set to TRUE.
further graphical parameters (see
dotPlot a invisible matrix containing NA's and numeric values representing values in a bin. The number of bins is given by the number of columns of the matrix.
values in x are assigned to the bins defined by breaks. The actual binning is done using hist.
#create some data and grouping
x = rnorm(28)
g = rep(1:2, 14)
#dot plot with groups and no stacking
dotPlot(x, group = g, stacked = FALSE, pch = c(19, 20),
main = "Non stacked dot plot")
#dot plot with groups and stacking
x = rnorm(28)
dotPlot(x, group = g, stacked = TRUE, pch = c(19, 20),
main = "Stacked dot plot")