Plot legend with 2-d layout

3 ビュー (過去 30 日間)
dormant
dormant 2024 年 5 月 28 日
コメント済み: Voss 2024 年 6 月 3 日
Is it possible to do four (or more) plots using hold on and then create a legend that has a 2-d layout like this?

採用された回答

Voss
Voss 2024 年 5 月 28 日
You can at least get close:
x = 1:10;
y = randi(10,10,4);
figure
hold on
markers = '^^oo';
colors = 'rbrb';
names = ["A_";"B_"]+["i","j"];
for ii = 1:size(y,2)
plot(x,y(:,ii),markers(ii),'Color',colors(ii),'DisplayName',names(ii));
end
legend('NumColumns',2)
  2 件のコメント
dormant
dormant 2024 年 6 月 3 日
Thank you very much.
Voss
Voss 2024 年 6 月 3 日
You're welcome!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

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

タグ

製品


リリース

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by