Skip to content
Back to formatted view

Raw Message

Message-ID: <f8e6ff050803010645v7722eb30lbf9d7eec3ec18db6@mail.gmail.com>
Date: 2008-03-01T14:45:03Z
From: Hadley Wickham
Subject: Fitting long names in boxplot
In-Reply-To: <47C889F4.9010600@stamlab.org>

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/