フィルターのクリア

Make values on y-axis in histogram to shrink.

1 回表示 (過去 30 日間)
LOKESH
LOKESH 2012 年 4 月 22 日
I have a Histogram of Binary Image. On y-axis I have values up to 2000. How can make it small so that the graph appears big. For example how can show only 1000 values on y-axis instead of 2000..
Thanks

回答 (2 件)

Walter Roberson
Walter Roberson 2012 年 4 月 22 日
Change the number of bins in the histogram.

Image Analyst
Image Analyst 2012 年 4 月 22 日
A binary image will have only two bins, one at 0 and one at 1, since there are only two values (false and true, or 0 and 1) in the image. One bin will have some number of counts, like 1500, and the other bin will contain a value equal to the number of pixels in the image minus the count in the other bin.
If you want to clip the y axis to some value, you can use ylim:
ylim([0 1000]);
If you want to compress the y scale, then you can plot the log of the y values (the count values) instead of using it linearly:
pixelCounts = imhist(binaryImage, 2);
bar(log(pixelCounts));
but be sure to adjust the y axis labels to be the original y values instead of the logged y values.

カテゴリ

Help Center および File ExchangeHistograms についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by