Reputation: 10011
I have plotted with the following code:
library(ggplot2)
ggplot(data = mpg, aes(x = displ, y = cty))+
geom_point(aes(size = hwy, color = cyl, shape = drv))+
guides(colour = guide_colourbar(order = 1),
alpha = guide_legend(order = 2),
size = guide_legend(order = 3))
Now I want to change the legend's colour from black
to grey
(as shown in the image below), how could I do that? Thanks.
Upvotes: 0
Views: 48
Reputation: 173803
You can do:
library(ggplot2)
ggplot(data = mpg, aes(x = displ, y = cty))+
geom_point(aes(size = hwy, color = cyl, shape = drv))+
guides(colour = guide_colourbar(order = 1),
alpha = guide_legend(order = 2),
size = guide_legend(order = 3, override.aes = list(color = "gray")))
Upvotes: 1