The legend of the plot doesn't appear

2 ビュー (過去 30 日間)
Lucas Veit
Lucas Veit 2020 年 7 月 8 日
コメント済み: Lucas Veit 2020 年 7 月 8 日
Hi,
I want to plot a signal with a title and legend. But the legend doesn't appear on the plot, wheareas the title do.
Can someone help me please ?

回答 (2 件)

madhan ravi
madhan ravi 2020 年 7 月 8 日
  6 件のコメント
madhan ravi
madhan ravi 2020 年 7 月 8 日
Strange , try contacting the MathWorks support team for support.
Lucas Veit
Lucas Veit 2020 年 7 月 8 日
thanks

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


Image Analyst
Image Analyst 2020 年 7 月 8 日
編集済み: Image Analyst 2020 年 7 月 8 日
Works for me:
t = 20;
ech = 0.001;
k = 1;
for i = 0:ech:t
y(k,:) = [i 3+sin(4*i)/5+cos(8*i)/9];
k = k + 1;
end
plot(y(:,1),y(:,2));
legend("signal");
Except that I don't get a title on my plot using your very same code. I don't see how you got a title instead of a legend. Are you sure you're not confusing the legend (inside the box inside the plot) with a title?
Try, in the command window:
>> restoredefaultpath
and try again.
  1 件のコメント
Lucas Veit
Lucas Veit 2020 年 7 月 8 日
Finally I have found the problem. Yesterday I worked on a file but there was a mistake because of the legend of a plot, so the file "legend.m" opened and I changed something accidently. Now it workes again !

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

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by