Togaware DATA MINING
Desktop Survival Guide
by Graham Williams
Google

Tables Within Plots

Here is an example where we wanted to place a table within the plot.

x <- "Obs   SD   Mean
   4    1.5   6
   5    0.3   8
   6    2.1   7
   7    0.3   5"
obs <- read.table(textConnection(x), header=TRUE, as.is=TRUE)

plot(1:10, type="n" )
points(4:7, obs$Mean)
text(c(1.2, 2, 3), 8, labels=names(obs), cex=.7)
arrows(.75,7.75, 3.5, 7.75, length=0)
text(c(1.2, 2, 3), 7.5, labels=obs[1,], cex=.7)
text(c(1.2, 2, 3), 7.0, labels=obs[2,], cex=.7)
text(c(1.2, 2, 3), 6.5, labels=obs[3,], cex=.7)
text(c(1.2, 2, 3), 6.0, labels=obs[4,], cex=.7)
arrows(.75, 5.75,3.5, 5.75, length=0)



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