1

I am very new to R studio so sorry if the question is a bit simplistic. I am attempting to do a simple plot of my data with added error bars and an annotation of my P value, I also would like to change the labels currently present on my graph.

geom_errorbar(data = combinedsum, 
                aes(x = Salt_concentration, ymin = mean - se, ymax = mean + se),
                width = 0.3)
geom_errorbar(data = combinedsum, 
              aes(x = Salt_concentration, ymin = mean, ymax = mean),
              width = 0.2)
scale_y_continuous(name = "Generation time (Minutes)", 
                   limits = c(0, 180), 
                   expand = c(0, 0)) +
scale_x_discrete(name = "Salt concentration (%)", expand(0,0), limits = c(0, 10.3), breaks = c(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10)) 
annotate("text", x = 1.5,  y = 75,
         label = expression(italic(p)~"= 3.647e-05")) +
  theme_classic()

Any help would be greatly appreciated. Thank you!

Phil
  • 7,287
  • 3
  • 36
  • 66
LucyS
  • 11
  • 1
  • 1
    Have you checked the examples here? https://ggplot2.tidyverse.org/reference/geom_linerange.html For the annotation of pvalues I recommend to have a look at ggsignif or ggpubr packages. – Roman Jan 02 '23 at 16:03
  • 1
    We can't currently reproduce your graph because we can't access your dataset, `combinedsum`. Can you make your post [reproducible](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) and provide `dput(combinedsum)` (or use an example dataset that reproduces a similar graph)? – jrcalabrese Jan 02 '23 at 18:16
  • We're missing a significant portion of your plot code here (ex. `ggplot()` statement and any other geom calls), and there's no access we have to your `combinedsum` dataset. Please, make an example with a built-in dataset or share some/all of the dataset you are looking to use so that we can better help you. – chemdork123 Jan 04 '23 at 21:46

0 Answers0