Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/69.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R 更改气球图中点的大小并保持零值_R_Ggplot2 - Fatal编程技术网

R 更改气球图中点的大小并保持零值

R 更改气球图中点的大小并保持零值,r,ggplot2,R,Ggplot2,用这些数据 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.45555555555

用这些数据

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))
点变大了,但我失去了Porp为零的值

我尝试将1添加到所有Porp值中,但大小都相同


可以如图2所示增加点的大小,但也可以包括Porp为零的点。

您可以尝试使用
scale\u size\u continuous
及其
range
参数。例如,类似这样的事情:

p + scale_size_continuous(range = c(2, 10))
p+scale_size_area(max_size=10)
p + scale_size_continuous(range = c(2, 10))