You should be able to do this with scale_x_discrete
.
library(ggplot2)
df <- data.frame(x = 1:5, y = sample(1:10, 5, TRUE))
qplot(factor(x),y, data = df) +
scale_x_discrete(breaks = 1:5, labels=c("foo","bar","baz","phi","fum")) +
xlab(NULL)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…