![stackedBar.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/231668/stackedBar.png)
積み上げグラフのcolormapについて
조회 수: 15 (최근 30일)
이전 댓글 표시
スクリプトから生成される積み上げグラフにて凡例数が多い場合、
色が被ってしまい各データがどの凡例を表しているか分かりづらくなります。
そこでcolormapをlinesからcolorcubeに変更して、表示色を増やすことは可能でしょうか。
댓글 수: 0
채택된 답변
Akira Agata
2019년 7월 28일
たとえば以下のような方法ではいかがでしょうか?
% 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](https://www.mathworks.com/matlabcentral/answers/uploaded_files/231668/stackedBar.png)
추가 답변 (0개)
참고 항목
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!