Filter löschen
Filter löschen

Stacked bar plots - individual editing?

3 Ansichten (letzte 30 Tage)
Ana Castanheiro
Ana Castanheiro am 26 Jan. 2017
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)

Antworten (0)

Kategorien

Mehr zu Discrete Data Plots finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by