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일

0 개 추천

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개)

카테고리

제품

릴리스

R2024a

태그

질문:

2024년 5월 28일

댓글:

2024년 6월 3일

Community Treasure Hunt

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

Start Hunting!

Translated by