Holding plot legend inside loop & between two for loops
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I am writing legend inside for loop here i am able to hold plot but not the legend
0 Kommentare
Akzeptierte Antwort
Sean de Wolski
am 24 Okt. 2012
I would recommend against this workflow. Insert the legend once at the end. For example:
figure;
hold on;
h =zeros(10,1);
colors = 'rgbcyk';
for ii = 1:numel(h);
h(ii) = plot(1:10,rand(1,10)+sin(rand(1,10)),colors(rem(ii,6)+1));
end
legend(h)
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Legend finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!