total.score <- data.frame(total.score = rlnorm(200, 1, 0.75))
total.score$time <- rep(1:4, c(50, 50, 50, 50))
m <- ggplot(total.score, aes(x = time, y = total.score))
m + geom_jitter(position = position_jitter(width = 0.15)) +
xlab("time point") +
ylab("total score") +
stat_summary(fun.y = median, col = "red", pch = "-", size = 20, geom =
"point", alpha = 0.5) +
scale_x_continuous(breaks = c(1, 2, 3, 4))
but it is a hack and I'm sure there is a better solution and something
more obvious which I'm missing. Instead of the chunky bar, I'd prefer
something more subtle (possibly lwd=2 or even lwd=1) but with width the
same as the jitter width.
thanks for any suggestions.
Gary