How can I set up unequal bin widths in a histogram?
20 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Brielle Paladino
el 22 de Jun. de 2022
Respondida: Image Analyst
el 22 de Jun. de 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 comentarios
Respuesta aceptada
Más respuestas (1)
Image Analyst
el 22 de Jun. de 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 comentarios
Ver también
Categorías
Más información sobre Histograms en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!