フィルターのクリア

Matlab shows the histogram 3 times!

1 回表示 (過去 30 日間)
Tala Hed
Tala Hed 2017 年 1 月 13 日
コメント済み: Wilson A N 2017 年 1 月 16 日
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 件のコメント
Wilson A N
Wilson A N 2017 年 1 月 16 日
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

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeHistograms についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by