【发布时间】:2014-11-17 12:38:00
【问题描述】:
我在 R 中有以下代码:
library(ggplot2)
theme_set(theme_bw())
p <- ggplot(mtcars, aes(wt, mpg))
p <- p + geom_point(aes(colour = factor(cyl)))
p
导致:
每个图例条目周围都有一个灰色边框。怎么去掉?
【问题讨论】:
我在 R 中有以下代码:
library(ggplot2)
theme_set(theme_bw())
p <- ggplot(mtcars, aes(wt, mpg))
p <- p + geom_point(aes(colour = factor(cyl)))
p
导致:
每个图例条目周围都有一个灰色边框。怎么去掉?
【问题讨论】:
只需添加
+ theme(legend.key = element_rect(colour = NA))
【讨论】: