Color individual contributions bar graph with log scale

For a project I would like to make a bar graph with an y-axes as log scale.
This is done as follows:
bar(xdata, ydata, 'ShowBaseLine', 'off');
set(gca,'Yscale','log')
The base line is updated with a script available at the file exchange:
The ydata is build up as follows:
ydata = [y1 y2 ... yn]
Where each yn is a column. The rows of ydata correspond to the a specific xdata value.
Now I want for each xdata point the bars to be stacked on top each other and colour the individual contributions of y1 y2 ... yn to this specific value of x.
This is something which I can't get working. I think it has to due with the way updatbarplotbase works.
Can anyone provide me a hint?

 Accepted Answer

The way matlab plotted the individual contributions was the problem. Larger contributions where plotted on top of smaller ones.
To compensate for this, use the following code:
set(gca,'children',flipud(get(gca,'children')))
Thanks to The MathWorks Technical Support team.

More Answers (0)

Categories

Find more on Environment and Settings in Help Center and File Exchange

Products

Asked:

on 27 Feb 2012

Community Treasure Hunt

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

Start Hunting!