Adding legend to a plot

조회 수: 9 (최근 30일)
Mike
Mike 2013년 11월 5일
댓글: Mike 2013년 11월 5일
For a matrix where A= [ 1 2 3 4 5 ; 6 7 8 9 10]; the first column is the path ID and columns 2 through 5 is the path.
I want to plot these 2 lines on the same chart and use "1" and "6" as their legend ID's. Is this possible?
I used plot( x axis vector, A). Is there an option to specify the legend based on A?
  댓글 수: 2
Azzi Abdelmalek
Azzi Abdelmalek 2013년 11월 5일
What do you want to plot?
Mike
Mike 2013년 11월 5일
ahh I got it. I separated the matrix and used legend( path_ID (k)). Thanks

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

답변 (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