%% Refine Layout Method of Graph
% Create and plot a graph using the 'layered' layout method.

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

%
% Use the layout function to refine the hierarchical layout by specifying source nodes and a horizontal orientation.

layout(h,'layered','Direction','right','Sources',[1 4])

% Copyright 2015 The MathWorks, Inc.