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

    %% Change Layout of Graph
% Create and plot a graph using the |'layered'| layout.

% Copyright 2015 The MathWorks, Inc.

s = [1 1 1 2 2 3 3 4 5 5 6 7];
t = [2 4 5 3 6 4 7 8 6 8 7 8];
G = graph(s,t);
h = plot(G,'Layout','layered');

%%
% Change the layout of the graph to use the |'subspace'| method.
layout(h,'subspace')