
%Create A figure
figure
mainAxes = axes;
plot(mainAxes ,[0 1 2 3 4 5],[ 0 1 2 3 4 5],'r',[0 1 5],[ 0 0.5 0.7],'b');
xlabel 'This is an X Axis Label'
ylabel 'This is a Y Axis Label'
title(['A Generic Multiline' 10 'Figure Title'],'FontSize',24, ...
       'HorizontalAlignment','center');
set(gcf,'Color',[1 1 1]);
grid
patch1 = patch([0 2.5 5],[0 0.5 0],[.5 .5 0]);
patch2 = patch([0 2.5 5],[0.5 0 0.5],[.5 0 .5]);
legend('Red Line','Blue Line','Brown Patch','Purple Patch','Location','East');

%These text objects are created prior to splitting the axis
%so the 'Clipping' property must be 'On' for them to display
%properly
t1 = text(1,4,'Text Inside Left Pane', ...
          'BackgroundColor',[.7 .9 .7], ...
          'HorizontalAlignment','Center', ...
          'Clipping','On');  
t1 = text(4,4,'Text Inside Right Pane', ...
          'BackgroundColor',[.7 .9 .7], ...
          'HorizontalAlignment','Center', ...
          'Clipping','On');  


%This is where the Magic Happens
h = breakxaxis([2 3]);

%Text outside the axes can be added after splitting the axis.  There
%is no requirement for 'Clipping' to be 'On'.  However, the text 'Parent'
%property must be set to h.rightAxes or h.leftAxes
t1 = text(.1,5.1,'Text Outlide Left Pane', ...
          'BackgroundColor',[.8 .5 .5], ...
          'HorizontalAlignment','left', ...
          'VerticalAlignment','bottom', ...
          'Parent',h.leftAxes);  
t1 = text(4.9,5.1,'Text Outside Right Pane', ...
          'BackgroundColor',[.8 .5 .5], ...
          'HorizontalAlignment','right', ...
          'VerticalAlignment','bottom', ...
          'Parent',h.rightAxes); 



