Stacked bar plots - individual editing?

1 次查看(过去 30 天)
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 中查找有关 Bar Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by