How to create Ratio/percentile distribution plot
10 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Martin Auestad
am 13 Nov. 2020
Bearbeitet: Cris LaPierre
am 13 Nov. 2020
I have an array of data, all within a certain range. After performing some work on the data, I have a new array, which is inside the same range, but the dataset is of different size.
I would like to create a kind histogram plot, but having the y-axis go from 0% to 100%, which would present “how much of the data has a certain value”. The histogram functions, as far as I understand only tells “the number of datapoints which have this value”.
Any suggestions on how to create such a plot, or if there is a build-in function which does this? I would like to have the ability to specify the number of bins, as i can with standard histogram.
Also, is there a way to present the histogram plot as a graph instead of rectangles?
0 Kommentare
Akzeptierte Antwort
Cris LaPierre
am 13 Nov. 2020
Bearbeitet: Cris LaPierre
am 13 Nov. 2020
I'm not aware of something that would do this automatically, but it's pretty simple to update the y ticks of a histogram to do what you want.
d=rand([1,1000]);
edges = 0:.25:1;
histogram(d,edges);
yticklabels(yticks/numel(d))
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Histograms finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
