require(ggplot2)
## Loading required package: ggplot2
Build data frame for samples
percentage <- c(90.87500, 9.125, 46.67347, 53.32)
se <- c( 4.4, 4.4, 1.06, 1.06)
cell <- c("BS", "M", "BS", "M")
construct <- c("35S:I-75nt(gfp)-II:uidA","35S:I-75nt(gfp)-II:uidA","35S:uidA","35S:uidA")
data <-data.frame(construct, cell, percentage, se)
colnames(data) <- c("construct", "cell", "percentage", "se")
data$construct <- factor(data$construct, levels = c("35S:uidA","35S:I-75nt(gfp)-II:uidA" ))
For the error
limits <- aes(ymax = data$percentage + data$se, ymin=data$percentage - data$se)
dodge <- position_dodge(width=0.9)
The actual plot
barp <-ggplot(data, aes(x= cell, y = percentage, ymin=percentage -se, ymax=percentage+se)) +
geom_bar(stat="identity", fill="gray37", colour="white") +
theme_classic()+
geom_errorbar(width=0.25)+
theme(strip.background = element_rect(fill = "white", colour="white"))+
theme(strip.text.x = element_text(face = c("italic"), size = 13, hjust = 0.5, vjust = 0.7, ))+
facet_wrap(~ construct ) +
ylab ("Cells with GUS (%)") +
theme( axis.title.x = element_blank()) +
theme(aspect.ratio=0.5) +
ylim(0, 100)
barp