------------------数据(data2)---------------------
plate family Freq family_percent label_y
w1 f1 1 20 10
w1 f2 1 20 30
w1 f3 2 40 60
w1 f5 1 20 90
w1 f6 0 0 100
w2 f1 2 40 20
w2 f2 1 20 50
w2 f3 1 20 70
w2 f5 0 0 80
w2 f6 1 20 90
-----------------代码-------------------
data2<-read.table(file="data2.txt",sep=" ",quote="")
p<-ggplot(data2,aes(x=plate,y=family_percent,fill=family))+geom_bar(stat="identity")+guides(fill=guide_legend())
p<-p+geom_text(aes(y=label_y,label=family_percent),colour="white")
p
-----------------结果----------------------------
 
这样出来的结果会在标数据标签时把值为0的值也标上,如何让这些值不显示呢?