x = [1:10];
y = 2*x;
z = x+1.25*y;
z1 = z+x;
h(1)=subplot(4,1,1);
plot(x);
legend('x Variable','Location','NorthEastOutside');
h(2)=subplot(4,1,2);
plot(y);
legend('y var','Location','NorthEastOutside');
h(3)=subplot(4,1,3);
plot(z);
legend('z','Location','NorthEastOutside');
h(4)=subplot(4,1,4);
plot(z1);
legend('z1 point','Location','NorthEastOutside');
m=zeros(length(h),4);
for k=1:length(h)
m(k,:) = get(h(k),'Position');
end
m(:,3) = max(m(:,3));
for k=1:length(h)
set(h(k),'Position',m(k,:));
end