问题
What I'd like it's to remove those labels on the right side, the ones on gray boxes on the side. I'll give an example:
p <- ggplot(mtcars, aes(mpg, wt, col=factor(cyl))) + geom_point()
p + facet_grid(cyl ~ .)
Thanks in advance!
Juan
回答1:
The following would do that:
p <- ggplot(mtcars, aes(mpg, wt, col=factor(cyl))) + geom_point()
p <- p + facet_grid(cyl ~ .)
p <- p +theme(strip.text.y = element_blank())
Without rectangles
p <- ggplot(mtcars, aes(mpg, wt, col=factor(cyl))) + geom_point()
p <- p + facet_grid(cyl ~ .)
p <- p + theme(strip.background = element_blank(),
strip.text.y = element_blank())
来源:https://stackoverflow.com/questions/29303577/getting-rid-of-facet-grid-labels-on-those-gray-boxes