Is there a way to have facet_wrap() or facet_grid() wrap individual facet
labels so that I don't lose part of the text? Currently, I only see the
center characters. Before I removed the line break characters, I'd see
the center of each line -- a bit better, but not much.
If they labels are still too long, is there a way to adjust the typeface
size of only the facet labels to get them to fit? I thought I once found
how, but I can't find the reference. On p. 143 of the ggplot2 book, I see
the theme elements, but none seem to match the labels at the top of each
facet.
Thanks,
Bill
Those labels are called strips. Their width is set to the width of
the panel, and the height to the height of the text element. You'll
probably need to keep the newlines and make the font size smaller with
opts(strip.text.y)
Hadley
> --
> You received this message because you are subscribed to the ggplot2 mailing list.
> Please provide a reproducible example: http://gist.github.com/270442
>
> To post: email ggp...@googlegroups.com
> To unsubscribe: email ggplot2+u...@googlegroups.com
> More options: http://groups.google.com/group/ggplot2
>
--
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/
Thanks, Hadley. I put the newlines back in, and that fixes most of the
problem.
I tried pg+opts(strip.text.y=40) and pg+opts(strip.text.y=2), and I don't
really see a difference either in an R window or when I process the plots
with R2wd. What are the units of strip.text.y? Is there something else I
might be missing?
Thanks,
Bill
[inadvertently only sent to Hadley; resending it now to the list]
> I tried pg+opts(strip.text.y=40) and pg+opts(strip.text.y=2), and I don't
> really see a difference either in an R window or when I process the plots
> with R2wd. What are the units of strip.text.y? Is there something else I
> might be missing?
Incidentally, I had tried theme_update(strip.text.y=20) and then
redisplaying the graphic before. Is that the same as the opts() command?
Bill
You need:
+ opts(strip.text = theme_theme(size = 2)
See the polishing chapter in the book for more details.
Hadley
> You need:
>
> + opts(strip.text = theme_theme(size = 2)
>
> See the polishing chapter in the book for more details.
Hadley,
Thanks! I'll check it out later this morning.
Bill
--
Bill Harris http://makingsense.facilitatedsystems.com/
Facilitated Systems Everett, WA 98208 USA
http://www.facilitatedsystems.com/ phone: +1 425 374-1845