Legend - set legend to 2 group of data
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Hello I have two data (52,60 lines on plot) I want to have a legend like this
LINES 1 - colour blue
LINES 2 - colour red
But all the time I get the same blue colour because my legend count lines not the group of data . How to set it or skip values ?
I tried to do this like this :
ik=[X(M,N-1),X(M,N),X(M,N+1)];
h1=plot(ik,DataX,'-b');
hold on;
h2=plot(ik,DataY,'-r');
legend([h1 h2],{'ROI2','ROI3'}
??? Error using ==> horzcat
CAT arguments dimensions are not consistent.
M,N are single numbers eg. 100 (index)
0 Commenti
Risposte (1)
dpb
il 22 Dic 2013
Apparently Data[X|Y] have differing number of columns so since plot returns a column vector of line handles then [h1 h2] is trying to place to columns of different lengths side-by-side.
Use
[h1; h2]
or
[h1' h2']
instead.
0 Commenti
Vedere anche
Categorie
Scopri di più su Legend in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!