# Equal Bin Sizes in Histogram Probability Distribution Function (PDF)

5 views (last 30 days)
Nihar Jariwala on 7 Apr 2021
Answered: Jeff Miller on 7 Apr 2021
h1 = histogram(Duration);
h1.Normalization = 'probability';
h1.BinWidth = 0.0006;
hold on
h2 = histogram(Duration1);
h2.Normalization = 'probability';
h2.Binwidth = 0.0006;
hold off
xlabel ('Log {Bubble Duration(Seconds)}','Fontsize',16);
ylabel ('Probability Distribution Function','Fontsize',16);
set(gca,'xscale','log');
set(gca,'yscale');
% ylim([0 0.16])
xlim([0 0.05])
title ('Bubble Duration - 26LPS Toe & Recirculating Region','FontSize',20)
legend ('Toe of the Jump','Recirculating Region ~ 75mm','Fontsize',16);
Hi Everyone,
I am plotting a normalised histogram (probability) & I want it on a semi-log scale, i.e, I want my X-axis to be logarthmic & I want my Yaxis to be linear as it is.
How can I have bins of equal widths in a logarthmic scale. In linear scale it is easy just specify the Bin widths & it will be equal but how do i do it in a Logarthmic scale? I am also attaching my code below.
Any Help will be much appreciated.

Jeff Miller on 7 Apr 2021
The histogram function has a parameter 'BinEdges' that will allow you to specify any bins you like. So, make whatever bin edges you like--e.g., on a log scale such as mybinedges = exp(1:5).