www.gusucode.com > graphics 案例源码程序 matlab代码 > graphics/SpecifyBarColorUsingRGBValueExample.m

    %% Specify Bar Properties Using Name-Value Pairs
% Create a horizontal bar graph and set the line width to 2. Use RGB
% triplets to set the face color and edge color for the bars.

% Copyright 2015 The MathWorks, Inc.


y = [57,91,105,123,131,150,...
     170,203,226.5,249,281.4];

figure
barh(y,'FaceColor',[0,0.5,0.5],...
       'EdgeColor',[0,0,0.9],...
       'LineWidth',2)