Align axis label on the right with ggplot2
问题 Consider the following d = data.frame(y=rnorm(120), x=rep(c("bar", "long category name", "foo"), each=40)) ggplot(d,aes(x=x,y=y)) + geom_boxplot() + theme(axis.text.x=element_text(size=15, angle=90)) The x-axis labels are aligned by the center of the label. Is it possible to automatically align on the right so that every label would end right below the graph? 回答1: This is precisely what the hjust and vjust parameters are for in ggplot . They control the horizontal and vertical justification