Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/magento/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R中直方图轴上的千位分隔符_R_Histogram - Fatal编程技术网

R中直方图轴上的千位分隔符

R中直方图轴上的千位分隔符,r,histogram,R,Histogram,我想在我的柱状图中看到千分格式的x轴数字。那么比如说, y <- seq(10000, 100000, 10000) hist(y) yscales库有一个名为comma的函数,它可以按照您想要的方式格式化数字: library(scales) 不是你想要的,而是一个开始: q<-quantile(y,prob=seq(0,1,.1));hist(y,breaks=q,labels=comma(q)) 绘制不带x轴的直方图,然后使用轴手动添加: y <- seq(1000

我想在我的柱状图中看到千分格式的x轴数字。那么比如说,

y <- seq(10000, 100000, 10000) 
hist(y)

yscales
库有一个名为
comma
的函数,它可以按照您想要的方式格式化数字:

library(scales)

不是你想要的,而是一个开始:

q<-quantile(y,prob=seq(0,1,.1));hist(y,breaks=q,labels=comma(q))

绘制不带x轴的直方图,然后使用
轴手动添加:

y <- seq(10000, 100000, 10000) 
hist(y, xaxt="n")
axis(side=1, at=axTicks(1), 
     labels=formatC(axTicks(1), format="d", big.mark=','))

y我在写这篇文章时遇到了这个错误:plot.histogram(r,freq=freq1,col=col,border=border,angle=angle,:找不到函数“comma”。@amobishorden抱歉,我以为我包含了
库(scales)
部分。
y <- seq(10000, 100000, 10000) 
hist(y, xaxt="n")
axis(side=1, at=axTicks(1), 
     labels=formatC(axTicks(1), format="d", big.mark=','))