Plot legend with 2-d layout

2 次查看(过去 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)

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Legend 的更多信息

标签

产品


版本

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by