Customize axis labels

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)

Leave a Comment