Plot legend with 2-d layout
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1705371/image.png)
0 Kommentare
Akzeptierte Antwort
Voss
am 28 Mai 2024
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 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!