2014-03-07 61 views
1

,我有以下数据:如何创建加权饼图与GGPLOT2

#Celltype Weight 
abTcells 10.65 
Bcells 14.87 
DendriticCells 22.71 
gdTCells 8.6 
Macrophages 7.14 
Monocytes 6.43 
Neutrophils 4.13 
NKCells 6.94 
StemCells 11.44 
StromalCells 7.1 

如何使用ggplot来创建一个类似于由下面的Excel生成的图中: enter image description here

回答

5
ggplot(df,aes(x=factor(1),y=Weight,fill=Celltype))+ 
    geom_bar(width=1,stat="identity")+coord_polar(theta="y") 

enter image description here

+0

如果你想不带标签的轴nd,让我知道 –