The legend of the plot doesn't appear

조회 수: 3 (최근 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 CenterFile Exchange에서 Legend에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by