1

enter image description here

I would like to manually add text to indicate significant differences on my graphs by adding letters (e.g. a, b and c) over specific locations on my boxplot using ggplot2. So essentially, I want to be able to add text where I want on the plot.

I have added an example of a graph in the picture above. I have entered the letters (a,b,c) manually in Microsoft Word but I would like to be able to do this in R. Can someone please help? Thank you

3 Answers 3

1

just add this line to your code:

annotate("text", x = 3, y=10, label = "whatever")
 
Sign up to request clarification or add additional context in comments.

Comments

1

use ggplot(...) + geom_text() from ggplot2.

Comments

0

Alternatively, you can try this. "Data" and "variable" are just names for what you would put in:

ggplot(data,aes(x=variable))+
    geom_boxplot(aes(y=variable2),color="variable")

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.