figure;
lgd = [];
phf = [];
ph = cell(3,1)
subplot(2,2,1);
ph{1} = plot(rand(10,2),'s-');
phf = [phf; ph'];
lgd = [lgd,{['1']}];
hold on;
ph{2} = plot(rand(10,3),'x-')
phf = [phf; ph'];
lgd = [lgd,{['2']}];
subplot(2,2,3:4);
ph{3}=plot(rand(10,3),'o-');
phf = [phf; ph'];
lgd = [lgd,{['3']}];
sh=subplot(2,2,2);
p=get(sh,'position');
lh=legend(sh,[ph{1,1};ph{2,1};ph{3,1}],lgd );
set(lh,'position',p);
axis(sh,'off');