필터 지우기
필터 지우기

Stacked bar plots - individual editing?

조회 수: 3 (최근 30일)
Ana Castanheiro
Ana Castanheiro 2017년 1월 26일
Hi guys! Basically I need to have something like the bar plot below, but need to be able to change the color of the individual squares, as well as giving them the appropriate label (the blue square in PM subdivide into the 2 squares in PM10).
Using 'grouped' instead of 'stacked' does not solve my problem. Also tried to create each stacked bar (each column) separately and then put them in the same graph, but this does not work out. I guess my problem is related with the input arguments to build the bar plot, but how to change this so that the shown strucuture is kept, while each "value" (square) can be edited independently (color, labelling)?
Any help is appreciated!
That image is created with this code - detsize{i} with i=3 to 6, are values extracted from a table:
sizeclass_stack1 = [detsize4{4} detsize4{3}; detsize4{6} detsize4{5}];
bar(sizeclass_stack1,'stacked')
title(sprintf('%s_',filename));
ylabel('Particle size distribution (%)','FontSize',12,'FontWeight','bold');
labels = {'PM';'PM_{10}'};
set(gca,'xticklabel',labels)

답변 (0개)

카테고리

Help CenterFile Exchange에서 Discrete Data Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by