Hide facet labels and panels?

5,066 views
Skip to first unread message

luis schiumerini

unread,
Jan 13, 2012, 1:03:11 PM1/13/12
to ggplot2
Hi all,

I have a very simple question that I haven't been able to address after several online queries: Is there any way of hiding the facet labels and panels in ggplot2? I am combining four plots column-wise and having the facet labels and panels in each one would be redundant. I am using facet_grid by the way.

Thanks
Luis

Aaron Wolen

unread,
Jan 13, 2012, 5:29:28 PM1/13/12
to ggp...@googlegroups.com
Is this what you're looking for? 

p <- ggplot(diamonds, aes(carat)) + 
geom_histogram(binwidth = 0.2) +
facet_grid(cut ~ clarity)

# Remove facet labels
p <- p + opts(strip.text.x = theme_blank(),
strip.text.y = theme_blank())

# Remove strips
p <- p + opts(strip.background = theme_blank())

luis schiumerini

unread,
Jan 13, 2012, 5:33:24 PM1/13/12
to ggp...@googlegroups.com
Exactly right! I can't believe it was so easy. In previous attempts I managed to hide the labels but not the strips. Thanks a lot.

--
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

Reply all
Reply to author
Forward
0 new messages