ヘルプ センターヘルプ センター
ヒストグラムのビン数の削減
N = fewerbins(h)
N = fewerbins(h,direction)
例
N = fewerbins(h) はヒストグラム h のビンの数を 10% 減少し (最も近い整数に切り捨て)、新しいビン数を返します。
N
h
二変量ヒストグラムの場合、x と y の両方向でビン数が減少します。
N = fewerbins(h,direction) は、direction で指定された次元でのみビン数を減少します。ここで、h は histogram2 オブジェクトでなければなりません。direction オプションには 'x'、'y' または 'both' を指定できます。既定値は 'both' です。
direction
histogram2
'x'
'y'
'both'
すべて折りたたむ
1,000 個の乱数のヒストグラムをプロットし、histogram オブジェクトのハンドルを返します。
x = randn(1000,1); h = histogram(x)
h = Histogram with properties: Data: [1000x1 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 0 0] Use GET to show all properties
fewerbins を使用してヒストグラム内のビンの数を削減します。
fewerbins
fewerbins(h); fewerbins(h)
ans = 18
histogram
入力ヒストグラム。histogram オブジェクトまたは histogram2 オブジェクトとして指定します。
h をカテゴリカル ヒストグラムにすることはできません。
ビン数を減少する方向。'x'、'y'、'both' のいずれかとして指定します。指定した方向でのみビン数を減少し、他の方向のビン数は変更しない場合、'x' または 'y' を指定します。
ビンの数。スカラーまたはベクトルとして返されます。N は、増やした後のヒストグラムの新しいビンの数です。二変量ヒストグラム プロットの場合、N は 2 要素ベクトル [nx ny] です。
[nx ny]
R2014b で導入
histogram | histcounts | histogram2 | histcounts2 | morebins
histcounts
histcounts2
morebins
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office