How can I set up unequal bin widths in a histogram?
조회 수: 17 (최근 30일)
이전 댓글 표시
I need to generate a histogram with 3 buckets that are all values less than 1, all values between 1 and 8, and all values over 8 on the Y-axis.
Here is what I have so far:
CV = dlmread('F:\Thesis\ProcessedData\Isotope Data\Tritium\CentralValleyTritium.csv',',');
histogram(CV,3,"Normalization","probability","DisplayStyle","bar")
%xticks([])
yticks([0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1])
yticklabels(yticks*100)
title('Central Valley aquifer system');
ylabel('Frequency (%)');
xlabel('Tritium (T.U.)')
댓글 수: 0
채택된 답변
추가 답변 (1개)
Image Analyst
2022년 6월 22일
You can define the edges however you want, like
data = -5 + 15* rand(100)
edges = [-inf, 0, 0.3, 0.4, 0.99, 8, inf] % or whatever...
histObject = histogram(data, edges)
grid on;
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Histograms에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!