Filter löschen
Filter löschen

Normalize y axis in Matlab histogram2 Percentage

8 Ansichten (letzte 30 Tage)
Megan
Megan am 4 Dez. 2019
Bearbeitet: Megan am 19 Feb. 2020
Hi guys,
i have a histogram (histogram2)
on the z axis there is the frequency (how many)
But I dont want so see 15000 or something like that. I Want to see Percentage 0-100%

Antworten (1)

KALYAN ACHARJYA
KALYAN ACHARJYA am 4 Dez. 2019
This example gives you the hints, just divide the y with total elements
ran_data=randi(15,[1 150]); % Just random data
[result_per bin]=hist(ran_data);
bar(result_per/150); % divide by total elements, here array size 150

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by