代码语言:javascript复制
library(tidyverse)
dt <- diamonds[1:1000, ]
如题:
代码语言:javascript复制p1 <- dt %>%
ggplot(aes(x = carat, y = cut, color = cut))
geom_point()
labs(title = "修改前")
p2 <- dt %>%
ggplot(aes(x = carat, y = cut, color = cut))
geom_point()
guides(color = guide_legend(override.aes = list(size = 3)))
labs(title = "修改后")
p1 p2