R - ggplot2 change x-axis values to non-log values

允我心安 提交于 2019-12-05 10:27:38

Not sure if this is exactly what you are after but you can change the text of the x axis labels to whatever you want using scale_x_continuous.

Here's without:

ggplot(data = cars) + geom_histogram(aes(x = speed), binwidth = 1)

Here's with:

ggplot(data = cars) + geom_histogram(aes(x = speed), binwidth = 1) +
  scale_x_continuous(breaks=c(5,10,15,20,25), labels=c(exp(5), exp(10), exp(15), exp(20), exp(25)))
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!