Changing the xlabel position property results in MATLAB treating the xlabel and the axis as two independent objects so that when the PRINT command resizes the figure to fit the paper, these two objects are not where they should be relative to each other.
As a workaround, use a multiline xlabel instead of changing the Position property.
x=1:10;
y=1:10;
scrsz = get(0,'ScreenSize');
figH=figure('Position',[scrsz(1) scrsz(2) scrsz(3) scrsz(4)]);
plot(x,y)
set(gca,'fontsize',20)
xlabel_h=xlabel({'','test',''},'fontsize',20);
print -depsc img.eps
Best Answer