How can I set up unequal bin widths in a histogram?
18 次查看(过去 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!