MATLAB Legend Icon Colors

조회 수: 9 (최근 30일)
Elijah Rockers
Elijah Rockers 2016년 3월 23일
댓글: the cyclist 2016년 5월 25일
This simplified example of my original problem also exhibits the same behavior. The legend is using the correct marker shapes, but not the correct color. It seems to use the color of the most recently created object.
EDIT: I am using MATLAB R2015b
figure;
P1 = scatter(4, 6);
hold on;
P2 = scatter(2, 9);
hold off;
set(P1, 'CData', [1 0 0]);
set(P2, 'CData', [0 0 1]);
set(P1, 'Marker', 's');
set(P2, 'Marker', '^');
legend('P1', 'P2');
xlim([0 10]);
ylim([0 10]);

채택된 답변

Mike Garrity
Mike Garrity 2016년 3월 23일
That sounds like bug 1283854. If so, it's fixed in R2016a, and there is a patch on the bug report page.
  댓글 수: 2
Amir Mohammad Alizadeh
Amir Mohammad Alizadeh 2016년 5월 25일
the link is not operational.
the cyclist
the cyclist 2016년 5월 25일
The link worked for me, just now.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

the cyclist
the cyclist 2016년 3월 23일
I think you are seeing a known MATLAB bug. Solutions are discussed in this answer.

카테고리

Help CenterFile Exchange에서 Legend에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by