How can I label symbols and colors of markers in scatter (example)

1 回表示 (過去 30 日間)
Johannes
Johannes 2018 年 11 月 25 日
回答済み: Walter Roberson 2018 年 11 月 25 日
Hey,
I have to scatter 2 different vars of 2 measurements like in the picture below. The marker symbol describes the variable which is plotted, the color is for different measurements. How can I create two legends, one for the symbol, one for the color?
figure(1);
hold on
y1 = scatter(measurement1.n, measurement1.var1, 'ro');
y2 = scatter(measurement1.n, measurement1.var2, 'rv');
y3 = scatter(measurement2.n, measurement1.var1, 'bo');
y4 = scatter(measurement2.n, measurement1.var2, 'bv');
Bildschirmfoto 2018-11-25 um 12.39.59.png

採用された回答

Walter Roberson
Walter Roberson 2018 年 11 月 25 日
create additional objects with position nan and the attributes you want in the legend , and legend() the handles for those specifically .

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLegend についてさらに検索

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by