積み上げグラフのcolormapについて

スクリプトから生成される積み上げグラフにて凡例数が多い場合、
色が被ってしまい各データがどの凡例を表しているか分かりづらくなります。
そこでcolormapをlinesからcolorcubeに変更して、表示色を増やすことは可能でしょうか。

 采纳的回答

Akira Agata
Akira Agata 2019-7-28

1 个投票

たとえば以下のような方法ではいかがでしょうか?
% Sample data and color map
y = rand(3,10);
color = colorcube(size(y,2));
% Visualize the data
figure
h = bar(y,'stacked');
for kk = 1:numel(h)
h(kk).FaceColor = color(kk,:);
end
legend
stackedBar.png

1 个评论

Akira Agata様
ご回答ありがとうございます。

请先登录,再进行评论。

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 カラーマップ 的更多信息

产品

标签

Community Treasure Hunt

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

Start Hunting!