MATLAB 帮助中心
增加直方图的 bin 数量
N = morebins(h)
N = morebins(h,direction)
N = morebins(h) 将直方图 h 中 bin 的数量增加 10%(向上四舍五入为最近的整数),并返回新的 bin 数量。
N
h
对于二元直方图,这会增加 x 和 y 方向的 bin 数量。
示例
N = morebins(h,direction)(其中 h 必须是 histogram2 对象)只会增加 direction 指定的维度中的 bin 数量。direction 选项可以是 'x'、'y' 或 'both'。默认值为 'both'。
direction
histogram2
'x'
'y'
'both'
全部折叠
绘制由 1,000 个随机数构成的直方图并返回直方图对象的句柄。
x = randn(1000,1); h = histogram(x)
h = Histogram with properties: Data: [1000×1 double] Values: [3 1 2 15 17 27 53 79 85 101 127 110 124 95 67 32 27 16 6 6 4 1 2] NumBins: 23 BinEdges: [-3.3000 -3.0000 -2.7000 -2.4000 -2.1000 -1.8000 -1.5000 -1.2000 -0.9000 -0.6000 -0.3000 0 0.3000 0.6000 0.9000 1.2000 1.5000 1.8000 2.1000 2.4000 2.7000 3 3.3000 3.6000] BinWidth: 0.3000 BinLimits: [-3.3000 3.6000] Normalization: 'count' FaceColor: 'auto' EdgeColor: [0.1294 0.1294 0.1294] Show all properties
使用 morebins 增加直方图中的 bin 数量。
morebins
morebins(h); morebins(h)
ans = 29
histogram
输入直方图,指定为 histogram 或 histogram2 对象。
h 不能是分类直方图。
要增加 bin 数量的方向,指定为 'x'、'y' 或 'both'。指定 'x' 或 'y' 以仅增加该方向的 bin 数量,其他方向的 bin 数量保持不变。
bin 数量,以标量或向量形式返回。N 是增加后的新的直方图的 bin 数量。对于二元直方图,N 是二元素向量 [nx ny]。
[nx ny]
在 R2014b 中推出
histogram | histcounts | histogram2 | histcounts2 | fewerbins
histcounts
histcounts2
fewerbins
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
欧洲
亚太
联系您当地的办事处