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

    %% Adjust Histogram Color Properties
% Generate 1,000 random numbers and create a histogram. Return a handle to
% the histogram object to adjust the properties of the histogram
% without recreating the entire plot.

% Copyright 2015 The MathWorks, Inc.

x = randn(1000,1);
h = histogram(x)

%%
% 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';