感谢您的数据!
按照 Jon Spring 的建议,我与 ggforce 玩了一会儿(上面的评论)
library(ggforce)
df=data.frame(point=c("AB","AC","ABC"),
x=1:3, # x coordinate of point center
y=c(0.5,2,0.5),# y coordinate of point center
A=c(0.5,0.5,1/3), # I chose different values
B=c(0.7,0,1/4), # to make the resulting plot
C=c(0,0.5,1/3)) # a little more interesting
df=pivot_longer(df,cols=c(A,B,C),names_to = "colorby",values_to = "amount")
df$radius=sqrt(df$amount) # since we have a number represented by area
ggplot(df)+
geom_polygon(aes(x=x,y=y),color="black",fill=NA,size=2)+ # draws the line connecting the points
geom_arc_bar(aes(x0=x,y0=y,r0=0,r=radius,amount=amount,fill=colorby),stat="pie")+
coord_equal()+ # so one gets actually circles
scale_fill_manual(values = c("A"="red","B"="blue","C"="green"))
如果你只想要“饼图”,你可以设置r=1(或其他合适的值)