Histogram plot isn't shown properly.

조회 수: 5 (최근 30일)
Vaswati Biswas
Vaswati Biswas 2021년 3월 7일
댓글: Vaswati Biswas 2021년 3월 7일
When I am trying to plot the Histogram it looks like as shown below. If I try to scale the y axis as it is too high the variation in the lower values aren't seen. How to show a proper histogram plot so that the variation in the lower side can be also seen along with the highest point in the y axis? Kindly help
  댓글 수: 3
Vaswati Biswas
Vaswati Biswas 2021년 3월 7일
I am new to Matlab. I have plotted this histogram from Jpeg image. Would you please tell me how can I normalise the histogram plot?
dpb
dpb 2021년 3월 7일
Can't change the characteristics of the image; any linear scaling of the axis will only change the numerical values, not the shape.
The usual "trick" for data which have a very large dynamic range is to use log scaling on one or both axes...
histogram(yourData)
hAx=gca; hAx.YScale='log'; % get axes handle; set y axis to logarithmic

댓글을 달려면 로그인하십시오.

채택된 답변

dpb
dpb 2021년 3월 7일
편집: dpb 2021년 3월 7일
Can't change the characteristics of the image; any linear scaling of the axis will only change the numerical values, not the shape.
The usual "trick" for data which have a very large dynamic range is to use log scaling on one or both axes...
histogram(yourData)
hAx=gca; hAx.YScale='log'; % get axes handle; set y axis to logarithmic
Illustration...
x=logspace(0,6,1000).';
nexttile, histogram(x)
nexttile, histogram(x), hAx=gca;hAx.YScale='log';
produced:
The downside is you can't have identically zero on the axis (there is no free lunch).
  댓글 수: 1
Vaswati Biswas
Vaswati Biswas 2021년 3월 7일
Yeah it solves the problem. Thank you so much

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

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