[R] Fitting long names in boxplot

Henrique Dallazuanna wwwhsd at gmail.com
Sat Mar 1 01:47:31 CET 2008


Try this:

Assuming that 'build' is a factor

par(mar=c(7,2,2,2), xpd = TRUE)
boxplot(time ~ build, horiz = T, col='lightblue', xaxt='n')
text(1:nlevels(build), par("usr")[3]-0.50, levels(build), srt=45, cex=0.6)




On 29/02/2008, Alex Reynolds <areynolds at stamlab.org> wrote:
> I have the following code:
>
>  subsetTimeDataPlot <- boxplot(subsetTimeData$time ~
>  subsetTimeData$build, horizontal=True, col="lightblue", ...)
>
>  The 'names' component consists of strings that can be up to 20-30
>  characters long.
>
>  How would I go about drawing the names vertically (not the boxplot) or
>  shrinking the names text (I tried cex.names=0.7 but this didn't help).
>
>  Thanks for any advice, I apologize if these are stupid questions,
>
>  -Alex
>
>  --
>  Alex Reynolds
>  University of Washington Medical Genetics
>  2211 Elliot
>  Seattle, WA 98121
>  areynolds at stamlab.org
>
>  ______________________________________________
>  R-help at r-project.org mailing list
>  https://stat.ethz.ch/mailman/listinfo/r-help
>  PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>  and provide commented, minimal, self-contained, reproducible code.
>


-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40" S 49° 16' 22" O



More information about the R-help mailing list