ggplot2 R fix x-axis label at a specific point relative to plot
问题 Say I have a plot like this: library(ggplot2) dat <- data.frame(x = 1:10, y = 1:10) ggplot(dat, aes(x = x, y = y)) + geom_point() + xlab("Test label") Does ggplot2 allow for fixing the xlab positioning at a specific point? Say I wanted the label to appear centered at the point where x = 7 (rather than the default centering). 回答1: This isn't exactly what you want, but you can adjust the horizontal justification in the theme options. This is relative between 0 and 1, not tied to the data