Holding plot legend inside loop & between two for loops
조회 수: 1 (최근 30일)
이전 댓글 표시
I am writing legend inside for loop here i am able to hold plot but not the legend
댓글 수: 0
채택된 답변
Sean de Wolski
2012년 10월 24일
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
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Legend에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!