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

    %% Specify Histogram Colors   

% Copyright 2015 The MathWorks, Inc.


%% 
% Generate 1,000 random numbers and create a
% histogram.  

data = randn(1000,1);
hist(data)  

%% 
% Get the handle to the patch object that creates the histogram plot. 
h = findobj(gca,'Type','patch');  

%% 
% Set the face color of the bars plotted to 
% an RGB triplet value of |[0 0.5 0.5]|. Set the edge color to white.
h.FaceColor = [0 0.5 0.5];
h.EdgeColor = 'w';