link: https://github.com/hadley/ggplot2/wiki/Faceting-Attributes
Example:
plot <- ggplot(data = xy)+
geom_point(aes(x = x, y = y))+
facet_grid(type ~ type2)
plot
## strip.background (rect)
plot + opts(strip.background = theme_rect(colour = 'purple', fill = 'pink', size
= 3, linetype='dashed'))
## if I change the fill argument to e.g. fill = c("green", "pink", "orange"),
all rectangles become green, but I would like to have for each rectangel an
other colour.
Can somebody help me out, how to solve this problem. Thanks a lot in advance.
Conradin
perhaps it is better to edit the grid objects after plot:
plot
mapply(
function(g, co)grid.edit(g$name, gp=gpar(fill=co)),
grid.gget(gPath("strip_h","strip.background"),grep=T),
c("green","blue","yellow")
)
--
Kohske Takahashi <takahash...@gmail.com>
Research Center for Advanced Science and Technology,
The University of Tokyo, Japan.
http://www.fennel.rcast.u-tokyo.ac.jp/profilee_ktakahashi.html
> --
> 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
>
Hadley
--
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/