p7=7;p8=8;p9=9;p1=1;p2=2;p3=3;p5=5;p6=6;

% get a fresh figure
% (use clear all if you want to get rid)
figure
subplot(3,3,p7)
title 'Potential energy'
hold on 
subplot(3,3,p8)
title 'Kinetic energy'
hold on 
subplot(3,3,p9)
title 'Total energy'
hold on 
subplot(3,3,p1)
title 'x'
axes
axis equal;
hold on 
subplot(3,3,p2)
title 'p'
axis equal;
hold on 
subplot(3,3,p3)
title 'force'
axis equal;
hold on 
subplot(3,3,p5)
title 'p'
axis equal;
hold on 
subplot(3,3,p6)
title 'force'
axis equal;
hold on 
handle=get(gcf,'Children') ; 
