Jorge Mendoza Ruiz
Jorge Mendoza Ruiz

Reputation: 316

Insert text in geom_bar

I am trying to make a barplot in R using ggplot2. I want to put the text D=3 in the graph located in the middle of x axis and in y=0.55, but I don´t know how. I've been looking for a solution but I have not found anything.

Thanks for helpenter image description here

Upvotes: 0

Views: 303

Answers (1)

Jorge Mendoza Ruiz
Jorge Mendoza Ruiz

Reputation: 316

I just found the answer in a blog. I just needed to use this code geom_text(data = NULL, x = 3.5, y = 0.55, label = "D=3", size=10) and I got next graph. I hope it can be useful for any of you. enter image description here

Upvotes: 2

Related Questions