R-自定义直方图中的X轴值 [英] R - Customizing X Axis Values in Histogram
本文介绍了R-自定义直方图中的X轴值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在R中的直方图中更改x轴上的值.
I want to change the values on the x axis in my histogram in R.
计算机当前将其设置为
0, 20, 40, 60, 80, 100.
我希望x轴像这样移动10倍:
I want the x axis to go by 10 as in:
0,10,20,30,40,50,60,70,80,90,100.
我知道要摆脱当前的轴,我必须这样做
I know to get rid of the current axis I have to do this
(hist(x), .... xaxt = 'n')
然后
axis(side = 1) .....
但是如何获取需要显示的数字呢?
But how do I get it to show the numbers that I need it to show?
谢谢.
推荐答案
答案就在?axis
...
dat <- sample(100, 1000, replace=TRUE)
hist(dat, xaxt='n')
axis(side=1, at=seq(0,100, 10), labels=seq(0,1000,100))
这篇关于R-自定义直方图中的X轴值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文