필터 지우기
필터 지우기

colors of barh

조회 수: 13 (최근 30일)
am
am 2012년 5월 10일
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.

답변 (2개)

Thomas
Thomas 2012년 5월 10일
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 2012년 5월 10일

카테고리

Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by