Dotplots
- stripchart(urb) Simple dotplot
- stripchart(urb ~ continents)dotplot by continent
- stripchart(urb, method="jitter") jittered dotplot, instead of default overplot.
- stripchart(urb, method="stack")stacked dotplot, instead of default overplot.
- stripchart(urb,pch=20 uses plot symbol (marker 20).
pch is a general graphical argument, available for most graphical functions. To see
what is available see the documentation. 20 is a small filled circle, 21 a bigger circle, 22 a square, 23 a diamond...
- It is often useful to get information about data density with another graph, e.g. a histogram.
hist(urb)
rug(urb)
rug() adds a rug ("bar-code") to the histogram.
lattice library
The lattice library lets you produce Dotplots using the dotplot function
- dotplot(urb)
- dotplot(urb ~continents) same by continent
Variations
- beeswarm plot from library beeswarm
attach(world)
beeswarm(urb~continent,pch=16, col=rainbow(8))
#
# Boxplot beeswarm combination
boxplot(urb ~ continent)
beeswarm(urb ~ continent, col = 2, add = TRUE)