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

    %% Histogram with Semi-Transparent Bars
% Load the sample data.

% Copyright 2015 The MathWorks, Inc.

load carbig
%%
% Use the data to make histogram on a 7-by-7 grid of bins.
X = [MPG,Weight];
hist3(X,[7 7]);
xlabel('MPG'); ylabel('Weight');
%%
% Make a histogram with semi-transparent bars.
hist3(X,[7 7],'FaceAlpha',.65);
xlabel('MPG'); ylabel('Weight');
set(gcf,'renderer','opengl');
%%
% Specify bin centers, different in each direction; get back counts, but
% don't make the plot.
cnt = hist3(X, {0:10:50 2000:500:5000});