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

    %% Create Pie Chart with Offset Slices
% Create a pie chart of vector |X|.

% Copyright 2015 The MathWorks, Inc.


X = [1 3 0.5 2.5 2];
pie(X)

%%
% Offset the second and fourth pie slices by setting the
% corresponding |explode| elements to 1.

explode = [0 1 0 1 0];
pie(X,explode)