Equal Bin Sizes in Histogram Probability Distribution Function (PDF)
5 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
回答(1 个)
Jeff Miller
2021-4-7
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).
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Histograms 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!