R 画structure图

             id percent  k
1_B04_WL-1.fs_1   0.021 k3
1_B04_WL-1.fs_1   0.624 k2
1_B04_WL-1.fs_1   0.355 k1

 

K=3  数据输入如上面所示:

library(ggplot2)

ggplot(b,aes(id,percent,fill=k))+geom_bar(stat="identity",width=1)+xlab("")+ theme_bw()+ theme(panel.grid =element_blank())+theme(axis.text.x = element_blank())+theme(axis.ticks = element_blank())+scale_fill_manual(values=c("#E51712","#F18D2D","#3594D2"))+theme(panel.border = element_blank())

 

posted on 2017-03-29 16:27  yangyzh  阅读(761)  评论(0编辑  收藏  举报