How to have two different size legends in one ggplot?
问题 Imagine I plot this toy data: lev <- c("A", "B", "C", "D") nodes <- data.frame(ord=c(1,1,1,2,2,3,3,4), brand= factor(c("A", "B", "C","B", "C","D", "B","D"), levels=lev), thick=c(16,9,9,16,4,1,4,1)) edge <- data.frame(ord1=c(1,1,2,3), brand1=factor(c("C","A","B","B"), levels=lev),ord2=c(2,2,3,4), brand2=c("C","B","B","D"), N1=c(2,1,2,1), N2=c(5,5,2,1)) ggplot() + geom_point(data = nodes, aes(x = ord, y = brand, size = sqrt(thick)), color = "black", shape = 16, show.legend = T) + scale_x