%% Saving and Loading GraphPlot Objects
% Use the savefig function to save a graph plot figure.

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);
plot(G);
savefig('cubegraph.fig');
clear s t G
close gcf

%
% Use openfig to load the graph plot figure back into MATLAB. openfig also returns a handle to the figure, y.

y = openfig('cubegraph.fig');

%
% Use the findobj function to locate the correct object handle using one of the property values. Using findobj allows you to continue manipulating the original GraphPlot object used to generate the figure.

h = findobj('Marker','o')

% Copyright 2015 The MathWorks, Inc.