有了这些数据
Data <- structure(list(ObsVal = c(22L, 50L, 8L, 15L, 54L, 30L, 11L, 90L,
6L, 53L, 9L, 42L, 72L, 40L, 60L, 58L, 1L, 20L, 37L, 2L, 50L,
68L, 20L, 19L, 58L, 5L), Porp = c(0.0909090909090909, 0.02, 0,
0, 0, 0, 0.272727272727273, 0.455555555555556, 0, 0.452830188679245,
0.111111111111111, 0.404761904761905, 0, 0.025, 0.0166666666666667,
0.120689655172414, 0, 0.1, 0.108108108108108, 0, 0, 0.0294117647058824,
0, 0, 0.310344827586207, 0), Pred = c(26, 52, 6, 15, 39, 30,
13, 85, 8, 62, 5, 48, 92, 52, 71, 68, 1, 28, 47, 1, 41, 106,
29, 19, 39, 7)), .Names = c("ObsVal", "Porp", "Pred"), class = "data.frame", row.names = c(NA,
-26L))
和这段代码
require(ggplot2)
p <- ggplot(Data, aes(x=ObsVal, y=Pred, size=Porp))+
geom_point()+
geom_smooth(method=lm, color="red")+
theme_bw()+
guides(size=FALSE)
p
I can make this plot![enter image description here](https://i.stack.imgur.com/Ax9tQ.jpg)
但点太小了。当我用代码增加大小时
p+scale_size_area(max_size=10)
The dots get larger, but I loose the values where Porp is zero. ![enter image description here](https://i.stack.imgur.com/eiKvi.jpg)
我尝试将所有 Porp 值加 1,但大小都相同。
可以增加点的大小,如图 2 所示,但也可以包括 Porp 为零的点?