フィルターのクリア

Holding plot legend inside loop & between two for loops

1 回表示 (過去 30 日間)
shaz
shaz 2012 年 10 月 24 日
I am writing legend inside for loop here i am able to hold plot but not the legend

採用された回答

Sean de Wolski
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 件)

カテゴリ

Help Center および File ExchangeLegend についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by