2014-03-07 89 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,讓我知道 –