0

我正在尝试在世界地图上绘制饼图。到目前为止,这是我的代码的简化示例:

library(rworldmap)
library(ggplot2)
library(scatterpie)

WorldData <- map_data('world') 
toPlot <- data.frame(long = 0, lat = 0, r = 20, A = 5, B = 2, C = 10 )

dev.new();
ggplot( ) + 
  geom_polygon( data =  map_data('world') , aes(long, lat, group = group),
                fill = 'black', colour = 'grey', size=0.5 ) + 
  coord_fixed(1.3) + 
  
  geom_scatterpie(aes(x=long, y=lat, r=r ), 
                data = toPlot , cols=c("A", "B", "C"),
                color=NA, alpha=1, n = 1000 , linetype = 2 ) +
  theme(legend.position = 'none')

问题是饼图看起来很粗糙。我尝试更改用于绘制整个圆的点数(继承自 geom_arc_bar)和线型,但它似乎没有任何效果。

我怎样才能使它看起来更平滑?

4

0 回答 0