I use the following code to produce multiple boxplots, ranked by the mean value of the variables:
zx <- replicate (5, rnorm(50))
zx_means <- (colMeans(zx, na.rm = TRUE))
colnames (zx) <- seq_len (ncol (zx))
boxplot(zx [, order (zx_means)], horizontal = FALSE, outline = FALSE)
points(zx_means [ order (zx_means)], pch = 22, col = "darkgrey", lwd = 7)
(See this post for more details)
When I change the code to horizontal = TRUE
, I'm not able to make the points line up with the boxplots. Any ideas for how to properly add points
to horizontal boxplots?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…