Script plot_pos_size.m
Download Script plot_pos_size.m
set(gca,'units','normalized')
p = get(gca,'Position')
t = get(gca,'TightInset')
outp=get(gca,'outerposition')

x=-pi:.1:pi;y=sin(x);plot(x,y);axis tight;
title('The sine function');legend('sine','location','best');
xlabel('abscissa');ylabel('ordinate')

figure(2)

d=0.2;
p1=[p(1)+d, p(2)+d, p(3)-d, p(4)-d]
t1=t;
set(gca,'Position',p1)

x=-pi:.1:pi;y=sin(x);plot(x,y);axis tight;
title('The sine function');legend('sine','location','best');
xlabel('abscissa');ylabel('ordinate')
Back