Dot Charts

Please note: This entry is about what sometimes is called Cleveland dot plots, i.e. plots that typically display numerical values together with identifying labels.

There is another entity called dot chart or dot plot which is similar to a histogram, displaying a stylized version of the distribution of a data bundle. This can be created with the ggplot2 package's "geom_dotplot". Perhaps I will say more about this at a later stage.

Standard version

Often it will be advisable to sort data first via mydata <- mydata[order(mydata$var-to-be-sorted-by),].

Now a simple dot chart can be produced by

dotchart(mydata$varname, labels=mydata$varname2, cex=.7, main="Title-for-chart", xlab="Label-for-x-axis")

Note that cex = ... refers to the size of the symbols (relative to the default). It will influence both the dots and the labels.

If mydata has row names (as will typically be the case) and these are to serve as labels, you will write:

dotchart(mydata$varname, labels=row.names(mydata), cex=.7, main="Title-for-chart", xlab="Label-for-x-axis")

Lattice version

The lattice package contains procedure dotplot, which may be outlined in more detail at a later stage.

© W. Ludwig-Mayerhofer, R Guide | Last update: 05 May 2025