%% Color Histogram Bars by Height
% Create a bivariate histogram using 1,000 normally distributed random numbers with 12 bins in each dimension. Specify FaceColor as 'flat' to color the histogram bars by height.

h = histogram2(randn(1000,1),randn(1000,1),[12 12],'FaceColor','flat');
colorbar

% Copyright 2015 The MathWorks, Inc.