필터 지우기
필터 지우기

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 CenterFile Exchange에서 Histograms에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by