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

    %% Create Compact Box Plots
%

%%
% Create a 100-by-25 matrix of random numbers generated from a standard
% normal distribution to use as sample data.
rng default  % For reproducibility
x = randn(100,25);

%%
% Create two box plots for the data in |x| on the same figure. Use the
% default formatting for the top plot, and compact formatting for the
% bottom plot.
figure

subplot(2,1,1)
boxplot(x)

subplot(2,1,2)
boxplot(x,'PlotStyle','compact')

%%
% Each plot presents the same data, but the compact formatting may improve
% readability for plots with many boxes.