Effacer les filtres
Effacer les filtres

colors of barh

13 vues (au cours des 30 derniers jours)
am
am le 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.

Réponses (2)

Thomas
Thomas le 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 le 10 Mai 2012

Catégories

En savoir plus sur Line Plots dans Help Center et File Exchange

Tags

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by