I am trying to coerce the ticks of the x-axis to be the individual characters in a character vector. How can this be accomplished?
I've tried:
char.list <- c('a','l','t','e','r','e','d')
times <- c(1:7)
df <- as.data.frame(list('chars'=char.list, 'times'=times))
g <- ggplot(data=df, aes(x=1:length(char.list), y=times)) +
scale_x_discrete("Characters",breaks=char.list,
labels=char.list) +
geom_point(aes(size=10, colour='red'))
When I try @Heroka's code, this results in:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.