Filter löschen
Filter löschen

colors of barh

13 Ansichten (letzte 30 Tage)
am
am am 10 Mai 2012
hello, i'm using the
barh(v,'stack')
function, where v is a matrix. the problem is that i cant figure how to make a different color for each value, for example i expect a [1,2,3;2,2,2] matrix to have 6 colors and [3,0,0;1,1,1] to have 4 colors. i tried using colormap but i didn't get 6/4 different colors. any suggestions? thanks.

Antworten (2)

Thomas
Thomas am 10 Mai 2012
Unfortunately that is not how barh works. You can find more documentation on barh usign
doc barh
%
v=[1,2,3;2,2,2];
barh(v,'stack')
will give you two stacked bar graphs of 3 colors since there are 3 element in both of your arrays.. All barh with 'stack' does is plot a bar graph make it horizontal and stacks values on each other instead of appearing as separate bars.
I donot think colormap will help you here either..

Image Analyst
Image Analyst am 10 Mai 2012

Kategorien

Mehr zu Line Plots finden Sie in Help Center und File Exchange

Tags

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by