Re: [R] Fitting long names in boxplot

From: hadley wickham <h.wickham_at_gmail.com>
Date: Sat, 01 Mar 2008 08:45:03 -0600

On Fri, Feb 29, 2008 at 4:40 PM, 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).

You might try:

library(ggplot2)
qplot(build, time, data=subsetTimeData, geom="boxplot") + coord_flip()

which will automatically allocate enough space for the names. You can find out more about ggplot2 at http://had.co.nz/ggplot2.

Hadley

-- 
http://had.co.nz/

______________________________________________
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.
Received on Sat 01 Mar 2008 - 14:47:54 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 01 Mar 2008 - 16:30:18 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive