Equal Bin Sizes in Histogram Probability Distribution Function (PDF)

8 visualizaciones (últimos 30 días)
Nihar Jariwala
Nihar Jariwala el 7 de Abr. de 2021
Respondida: Jeff Miller el 7 de Abr. de 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.

Respuestas (1)

Jeff Miller
Jeff Miller el 7 de Abr. de 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).

Categorías

Más información sobre Histograms en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by