Matlab shows the histogram 3 times!
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
I curve fit 4 distributions over a histogram. Each time that I use histfit command, it shows the corresponding histogram as well and at the end I have repetitive legends! Can any one help how to get rid of the redundant ones? The code is pretty simple!
sz=xlsread('sz418.xlsx');
mm=sz(:,1);
aa=sz(:,2);
k=histfit(mm,10,'normal')
hold on
h=histfit(mm,10,'inversegaussian')
h(2).Color = [.8 .2 .8];
p=histfit(mm,10,'lognormal')
p(2).Color = [.1 .1 .1];
pd = makedist('Normal',mean(mm),std(mm));
t = truncate(pd,0,1.2)
x = 0:.01:0.5;
plot(x,10*pdf(t,x),'Color','blue','LineWidth',2,'LineStyle',':')
hold off
1 comentario
Wilson A N
el 16 de En. de 2017
I tried running this code but didn't get the error. Initially I didn't even get the legend. I had to manually force it to appear by writing the the legend('show') command at the end of the above code. May be some of the options in the documentation link below may help
https://www.mathworks.com/help/matlab/ref/legend.html
Respuestas (0)
Ver también
Categorías
Más información sobre Histograms en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!