Hello,

I have a code like this:

p <- ggplot(data = df, aes(x = Name, y = prop, fill = Name)) +
  geom_bar(stat = "identity") +
  labs(x = "", y = "EQTL / gene") +
  scale_fill_brewer(palette="Greens",name = "Number of cis EQTL") +
  theme(legend.position = "none")
p
which produces the attached plot.
How do I add a horizontal lines in between middle points of two bars
above which I would have written: p = 2e-16

I tried adding this:

> p+ annotate("text", x = 1.5, y = 1.2, label = "p = 2e-16", size = 3.5) +
+   annotate("rect", xmin = 1, xmax = 2, ymin = 1, ymax =1,
alpha=0.3,colour = "black")
Error in annotate("text", x = 1.5, y = 1.2, label = "p = 2e-16", size = 3.5) :
  unused arguments (x = 1.5, y = 1.2, label = "p = 2e-16", size = 3.5)

Also how do I decrease size of these two bars?

Thanks
Ana
______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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