필터 지우기
필터 지우기

How can I give legend to a plot as a series?

조회 수: 2 (최근 30일)
kanyvt
kanyvt 2015년 4월 8일
댓글: Kelly Kearney 2015년 4월 9일
Suppose I have multiple graphs on a plot for a parameter varying from -4 to 0.25 with difference of 0.25 between adjacent values (which is about 18 in number)? Can I say like legend y. where y is a variable varying from -4 to 0.25?

채택된 답변

Kelly Kearney
Kelly Kearney 2015년 4월 8일
Example data:
x = 1:10;
h = plot(x, x'*p)
Create legend:
legend(h, cellstr(num2str(p', '%.2f')));
  댓글 수: 3
kanyvt
kanyvt 2015년 4월 9일
Could you please tell me what is p here?
Kelly Kearney
Kelly Kearney 2015년 4월 9일
Sorry, p was the parameter:
p = -4.0:0.25:0.25;

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

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