I want to add a rotating 45-degree x-label on my barplot, so I draw a label-free barplot and use text
function to add those labels. However, I found my labels did not locate exactly on the center of each bar as I set in the x
parameter (from 1 to 10). Why this happened and how to solve it? Thanks for any suggestion first.
My code:
barplot(10:1)
text(x = 1:10, y = par("usr")[3] - 0.45,
labels = LETTERS[1:10],
xpd = NA, srt = 45, cex = 1, adj = 1)
## srt is for rotating labels