Barplot with a lognormal distribution

2 visualizaciones (últimos 30 días)
Mads Søndergaard Larsen
Mads Søndergaard Larsen el 15 de Mayo de 2018
Comentada: Mads Søndergaard Larsen el 17 de Mayo de 2018
Hi, I have this barplot of some particles measured, fitted with a lognormal distribution. However, the y-values are too large. I have tried to normalize the data with trapz(n1000,x1000), but it did not work. Is it something to do with the bins? I have tried to vary this accordingly, for nbins=20, y did not vary as much.
[n1000,x1000]=hist(vol1000,);
n1000=n1000/length(vol1000)/diff(x1000(1:2));
bar1000=bar(x1000,n1000,'hist');
hold on
TF1000=isoutlier(vol1000,'mean');
mu1000=mean(log(vol1000));
std1000=std(log(vol1000));
ix1000=linspace(min(vol1000),max(vol1000));
iy1000=pdf('lognormal',ix1000,mu1000,std1000);
figure(7)
plot(ix1000,iy1000,'r')
xlabel('Volumes [µm^3]')
legend('Particle sizes','Log normal distribution')
title('Lognormal distribution of 1000 µL Ag seed prisms')
grid on
hold off
I hope someone can help. Thank you! Regards, Mads
  3 comentarios
dpb
dpb el 15 de Mayo de 2018
Editada: dpb el 15 de Mayo de 2018
It's a sorry interface for code; granted, but to enter code, highlight the lines wanted and the press the '{}Code' icon...or two spaces before first line of paragraph has same effect; lose the effect with blank line that way, though.
As far as the actual Q?; not much we can do w/o the data or at least the figure to see what of which you speak...
Mads Søndergaard Larsen
Mads Søndergaard Larsen el 17 de Mayo de 2018
You are right dpb, however I did figure it out in the end.
This was my first question here, therefore it seems a bit funny to look at. I'm sorry about the inconvenience - I should have checked the "Apps - Distribution" function from MatLab, as this yielded the right data in the end.

Iniciar sesión para comentar.

Respuestas (0)

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by