[R] Text on a boxplot graph

François Le Lay flelay at irisa.fr
Wed Apr 23 15:16:53 CEST 2003

Hi all,

Could anybody help me figure out how to write text on a boxplot. I have to 
plot 9 boxplots side by side on a single graph. On the x-axis I write numeric 
values with the 'names' argument but I'd like to add one label (character 
value) in the middle of each box. I know how to use the text() function for 
regular y~x plots but in this particular case, I'm kinda lost...
Here is my code:

# creating labels for x-axis labelling 
lb <- c()
for( n in names(o) )
  lb <- c(lb, paste("\n",n,"\n",o[[n]], sep=""))

        col.lab="dark red",
        main="Boxplots for Polling results, 1868 clusters, 9604 simulated 
        xlab="RED BOXPLOTS: precision dependent - GREEN BOXPLOT: null radius - 
BLUE BOXPLOTS: percent of exact radius",
 	       ylab="P(ID) values")

Thanks for your help,
IRISA-INRIA, Campus de Beaulieu, 35042 Rennes cedex, France
Tél: +33 (0) 2 99 84 71 00, Fax: +33 (0) 2 99 84 71 71

More information about the R-help mailing list