필터 지우기
필터 지우기

Plotting Legends of Rows of a Matrix ???

조회 수: 3 (최근 30일)
Serhat
Serhat 2013년 3월 30일
Hi all,
I have a matrix A=[1 2 3 4; 1 2 3 5; 2 3 4 5 ...]; I want to plot legend of the rows of A.
For pink curve, there will be a legend [1 2 3 4], for blue curve there will be a legend [1 2 3 5] etc. I want to change rows and colors and markers.
How can I do that??? (without writing one by one)
Thanks a lot.

답변 (1개)

Ahmed A. Selman
Ahmed A. Selman 2013년 3월 30일
A=[1 2 3 4; 1 2 3 5; 2 3 4 5];
plot(A)
C=num2str(A);
H=legend(C);
set(H,'Interpreter','none');
  댓글 수: 2
Serhat
Serhat 2013년 3월 31일
Thanks for answer. Could you explain what 'set' command doing there?
Additionally, my problem is bigger. I dont want the plot rows of A. I want to plot legends of rows of A.
I use this one: semilogy(X, t) But, X values here are changing according to the rows of A, so my aim is to show when I have different A values, I have different X.
Ahmed A. Selman
Ahmed A. Selman 2013년 3월 31일
set gives the graphic object (the plot window) its properties such as color, legend, .. etc. I think you should goto (from Edit menu-- Figure properties) and try (More Properties). There are a bunch of useful things to set up there, no need to write a code of any kind.
Regards :)

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

카테고리

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