I am using following commands to produce a scatterplot with jitter:
ddf = data.frame(NUMS = rnorm(500), GRP = sample(LETTERS[1:5],500,replace=T))
library(lat
For a lattice
solution:
library(lattice)
ddf = data.frame(NUMS = rnorm(500), GRP = sample(LETTERS[1:5], 500, replace = T))
bwplot(NUMS ~ GRP, ddf, panel = function(...) {
panel.bwplot(..., pch = "|")
panel.xyplot(..., jitter.x = TRUE)})
The default median dot symbol was changed to a line with pch = "|"
. Other properties of the box and whiskers can be adjusted with box.umbrella
and box.rectangle
through the trellis.par.set()
function. The amount of jitter can be adjusted through a variable named factor
where factor = 1.5
increases it by 50%.