I have two legends on my ggplot with two different legend titles (automatically created from ggplot()
). Now, I want to change this legend titles. + labs(
If I understood your point correctly, you can simply use + labs(shape = "shape legend title", colour = "colour legend title")
Here is an example using the iris
dataset:
data(iris)
ggplot(iris, aes(x=Sepal.Length, y=Sepal.Width)) +
geom_point(aes(shape=Species, colour=Petal.Width)) +
scale_colour_gradient() +
labs(shape="Species label", colour="Petal width label")
You specify the labels using labs()
, with each scale separately specified, i.e. labs(shape="Species label", colour="Petal width label")
.