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

6 visualizaciones (últimos 30 días)
Koki Hashiguchi
Koki Hashiguchi el 26 de Jul. de 2019
Comentada: Koki Hashiguchi el 29 de Jul. de 2019
スクリプトから生成される積み上げグラフにて凡例数が多い場合、
色が被ってしまい各データがどの凡例を表しているか分かりづらくなります。
そこでcolormapをlinesからcolorcubeに変更して、表示色を増やすことは可能でしょうか。

Respuesta aceptada

Akira Agata
Akira Agata el 28 de Jul. de 2019
たとえば以下のような方法ではいかがでしょうか?
% 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 comentario
Koki Hashiguchi
Koki Hashiguchi el 29 de Jul. de 2019
Akira Agata様
ご回答ありがとうございます。

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre カラーマップ en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!