我有这样的数据
year month Avdischarge IndustrialCompound Pharmaceutical Pesticide TotalOvershootings
37 2018 1 740.5200 0.0000000 1.0000000 0.0000000 0.1578947
38 2018 2 376.8050 0.0000000 1.0000000 0.0000000 0.1428571
39 2018 3 269.2800 0.4285714 0.5714286 0.0000000 0.2800000
40 2018 4 195.8825 0.0000000 1.0000000 0.0000000 0.2105263
41 2018 5 100.9800 0.2500000 0.5833333 0.1666667 0.3243243
42 2018 6 99.5775 0.0000000 1.0000000 0.0000000 0.2105263我先画了放电的图
q<- ggplot(data,aes(month, Avdischarge, group=1))+
geom_line(color='royalblue1', size=1.5, alpha=0.9))现在,我想将scatterpie图添加到放电图中
所以我就这么做了
pieper<-q +
scatterpie::geom_scatterpie(aes(x=month, y=2, group=type, r = TotalOvershootings/0.5),
cols= c("IndustrialCompound", "Pharmaceutical", "Pesticide"),alpha= 0.7, color=NA,data= data)但我明白了

我已经将r更改为每个可能的数字,但我没有正确获取派(如图所示)。当我改变r时,派变得更大,但总是成一条线,或者消失。
我还能添加什么,才能以正确的比例显示饼图?
发布于 2019-05-06 18:30:44
我认为这是一个可伸缩性问题。如果你只是绘制
q<- ggplot(data,aes(month, Avdischarge, group=1))+
scatterpie::geom_scatterpie(aes(x=month, y=2, group=type, r = TotalOvershootings/0.5),
cols= c("IndustrialCompound", "Pharmaceutical", "Pesticide"),alpha= 0.7, color=NA,data= data)它将所有内容打印为圆圈。你看到图表底部的颜色了吗?这些是圆圈。看看y轴,然后你会发现这些圆有另一个标度。
发布于 2019-05-21 20:45:43
您可以尝试将scale_y_log10()添加到代码中来解决此比例问题。(第一个图中的y太大,而第二个图中的y太小!所以试着通过使用scale_y_log10()来适当地调整他们的比例~
https://stackoverflow.com/questions/56003067
复制相似问题