How can I set up unequal bin widths in a histogram?
20 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Brielle Paladino
le 22 Juin 2022
Réponse apportée : Image Analyst
le 22 Juin 2022
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 commentaires
Réponse acceptée
Plus de réponses (1)
Image Analyst
le 22 Juin 2022
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 commentaires
Voir également
Catégories
En savoir plus sur Histograms dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!