Histogram x axis range
이전 댓글 표시
I am trying to plot the Histogram for a matrix which contains the values ranging from 0 to 0.1. However I wish to have the X axis values ranging from 0 to 1 with 20 bins (with each of 0.05 value difference). This is for me to show how the overall distribution is still less than 0.1 in the whole range of 0 to 1.
I tried the following code, and however, this does not work as the Histogram always shrinks the X-axis with values less than 0.1 (due to the maximum value in the matrix).
edges = [0 1];
histogram('BinEdges',edges,'BinCounts',20)
histogram( data(:));
Any help is appreciated for me to achieve this goal. Thanks
채택된 답변
추가 답변 (1개)
madhan ravi
2018년 12월 23일
h=histogram('BinEdges',edges,'BinCounts',20)
h.BinLimits=[0 1] % x-axis range
댓글 수: 3
Marimuthu Ananthavelu
2018년 12월 23일
madhan ravi
2018년 12월 23일
So remove BinCounts option and try?
Marimuthu Ananthavelu
2018년 12월 23일
카테고리
도움말 센터 및 File Exchange에서 Histograms에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
