Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting rid of facet_grid labels on those gray boxes?

Tags:

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 ~ .) 

enter image description here

Thanks in advance!

Juan

like image 354
Juan Avatar asked Mar 27 '15 14:03

Juan


People also ask

How do you remove facet labels?

Facet labelsSetting strip. text to element_blank() will remove all facet labels. You can also remove the labels across rows only with strip.

What is the difference between Facet_wrap and Facet_grid?

While facet_grid shows the labels at the margins of the facet plot, facet_wrap creates a label for each plot panel.

What is facet label?

Facet L herbicide harnesses the trusted control of Facet herbicide in a convenient liquid formulation, giving rice growers easy, consistent control of annual grasses and broadleaf weeds. Labels & sds.

What is Facet_grid?

facet_grid() forms a matrix of panels defined by row and column faceting variables. It is most useful when you have two discrete variables, and all combinations of the variables exist in the data.


1 Answers

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

enter image description here

like image 129
Ruthger Righart Avatar answered Sep 23 '22 16:09

Ruthger Righart