Desktop Survival Guide
by Graham Williams

Box and Whisker Plot: With Means

The simple box plot is extended to include the mean of each column. The means are calculated using scipy, and plotted as a + (pch=3).

rows <- 100
cols <- 17
  dataset <- matrix(rnorm(rows*cols), nrow=rows, ncol=cols)
  means <- mean(
  boxplot(, notch=TRUE, at=1:17,
          xlim=c(0, cols+1), ylim=c(-4,4), xaxt='n')
  axis(side=1, at=1:17, labels=letters[1:17])
  points(1:17, means, pch=3)

Copyright © Togaware Pty Ltd
Support further development through the purchase of the PDF version of the book.
The PDF version is a formatted comprehensive draft book (with over 800 pages).
Brought to you by Togaware. This page generated: Sunday, 22 August 2010