MATLAB Legend Icon Colors

6 ビュー (過去 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 Center および File ExchangeLegend についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by