gpt4 book ai didi

r - 摆脱那些灰色框上的 facet_grid 标签?

转载 作者:行者123 更新时间:2023-12-03 14:36:37 43 4
gpt4 key购买 nike

我想要的是删除右侧的那些标签,即侧面灰色框上的标签。我举个例子:

p <- ggplot(mtcars, aes(mpg, wt, col=factor(cyl))) + geom_point()
p + facet_grid(cyl ~ .)

enter image description here

提前致谢!

胡安

最佳答案

以下将做到这一点:

p <- ggplot(mtcars, aes(mpg, wt, col=factor(cyl))) + geom_point()
p <- p + facet_grid(cyl ~ .)
p <- p +theme(strip.text.y = element_blank())

没有矩形
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

关于r - 摆脱那些灰色框上的 facet_grid 标签?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29303577/

43 4 0