I have a data which I plot using this code.
Attached is the plot

_BEGIN_
library(ggplot2)
dat.m <- read.delim("http://dpaste.com/1269939/plain/",sep="";)
colnames(dat.m) <- c("ensg","mirna_hgc","variable","value")
dat.m.y <- subset(dat.m,dat.m$variable=="y")
qplot(value,data=dat.m.y, geom="bar",  origin=-0.05,
xlim=c(48,101),ylim=c(0,75), facets=variable~.,main="")+
xlab("Value")+
ylab("Frequency")+
theme(legend.position="none")+
stat_bin(aes(label = sprintf("%.01f",
(..count../288)*100)),size=2.5,color="red", vjust=-0.5, angle=0,
geom="text")
__END__

What I wan't to do is to get rid of the barplot labels when the value in red
is 0.0.
How can I go about it?

I tried this but it won't work
stat_bin(aes(label = sprintf("%.01f",
(..count../288)*100)),size=ifelse(dat$m.y>0,2.5,0),color="red", vjust=-0.5,
angle=0, geom="text")

Attachment: test.pdf
Description: Adobe PDF document

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to