Merge legends of separate geom layers
I am plotting point data from two separate layers on a map and would like to display the information of both layers in one legend. Here's some code to illustrate the problem: set.seed(42) lat1 <- rnorm(10, 54, 12) long1 <- rnorm(10, 44, 12) val1 <- rnorm(10, 10, 3) lat2 <- rnorm(10, 54, 12) long2 <- rnorm(10, 44, 12) val2 <- rnorm(10, 10, 3) df1 <- as.data.frame(cbind(long1, lat1, val1)) df2 <- as.data.frame(cbind(long2, lat2, val2)) library(ggplot2) library(scales) f <- ggplot() + geom_point(data=df1, aes(x=lat1, y=long1, size=val1, fill=val1), shape=21, alpha=0.6) + scale_size_continuous