필터 지우기
필터 지우기

Renaming data to create legend for figure ploting

조회 수: 8 (최근 30일)
Yat Chi
Yat Chi 2023년 12월 30일
댓글: Adam Danz 2023년 12월 30일
I designed a code to plot the data into a graph. It goes successfully but how can I rename the line in order according to the column in variable SNR_GNS and legend that into the figure? For example like the line in column 3 is renamed to G3 and line in column 10 is renamed to G10. Thanks
  댓글 수: 1
Adam Danz
Adam Danz 2023년 12월 30일
Images of code and data are really difficult to work with. Copying the sections of code/data as text makes it much easier to offer help.

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

채택된 답변

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2023년 12월 30일
It can be attained using legend() command, e.g.:
A = randi([-5 25], 5, 13);
B = 1:size(A,2);
plot(B,A, '-o', 'linewidth', 2)
xlabel('B')
ylabel('A series')
legend('A_1', 'A_2', 'A_3', 'A_4', 'A_5', 'Location', 'Best')

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Legend에 대해 자세히 알아보기

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by