如何在ggplot2中按变量分隔气泡图传奇

时间:2016-05-26 15:46:31

标签: r plot ggplot2 legend

我试图在ggplot2中建立一个有两个变量(Tmin和Tmax)的气泡图。问题在于传说是一个在另一个之上。我想要两个不同的传说。另外,我想将图例中的气泡增量调整为4到6个气泡大小。这是我到目前为止所拥有的:

ggplot() + geom_path(data = westUS, aes(x = long, y = lat, group =        group)) + 
geom_point(data = myData, aes(x = long, y = lat, size = Tmin), pch = 1, color = "blue", stroke = 0.3) + scale_size_continuous(range = c(-2, 7.5)) + theme_bw() +
geom_point(data = myData, aes(x = long, y = lat, size = Tmax), pch = 1, color = "red", stroke = 0.3) 

This is how the plot looks currently 谢谢!

0 个答案:

没有答案