MATLAB: How to make the number on yaxis of a histfit plot to a probability

histfithistogramnormalizeprobability

I have a histogram and fitted distribution. I want my y axis to be normalized. In other words instead of frequency on the y axis I want the probability.

Best Answer

The easiest way is just to recalculate the 'YTickLabel' values, if you only wnat to normalise the y-axis:
r = normrnd(10,1,100,1);
figure(1)
histfit(r)
yt = get(gca, 'YTick');
set(gca, 'YTick', yt, 'YTickLabel', yt/numel(r))