Togaware DATA MINING
Desktop Survival Guide
by Graham Williams
Google

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
pdf("graphics/rplot-boxplot-means.pdf")
  dataset <- matrix(rnorm(rows*cols), nrow=rows, ncol=cols)
  means <- mean(as.data.frame(dataset))
  boxplot(as.data.frame(dataset), 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)
dev.off()

http://rattle.togaware.com/code/rplot-boxplot-means.R



Copyright © 2004-2010 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