Skip to content

strip.text.y = element_blank() yields an error when there are multiple layers of strip labels #4050

Closed
@yqgchen

Description

@yqgchen

Hello,
I was trying to remove the strip labels. I found that setting strip.text.x = element_blank() works when there is only one layer of strip labels and yields an error when there are multiple layers of labels. Is there any way to remove the strip labels in the latter case? Many thanks!

# This works:
p1 <- ggplot(mtcars, aes(x = mpg, y = wt)) + geom_point() +
 facet_grid(vs + am ~ gear)  + theme(strip.text.x = element_blank())

#This does not work:
p2 <- ggplot(mtcars, aes(x = mpg, y = wt)) + geom_point() +
 facet_grid(vs + am ~ gear)  + theme(strip.text.y = element_blank())
#Error in gtable_add_grob(panel_table, strips$y$right, panel_pos_rows$t,  : 
#  Not all inputs have either length 1 or same length same as 'grobs'

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behaviorfacets 💎

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions