Format Position and size of plots

1 view (last 30 days)
Alexandre
Alexandre on 1 Jun 2017
Hi, I have a few plots (.fig) I need to reformat (examples attached). Somehow the size of the plot itself got bigger in some figures and the position of xlabel and ylabel changed. I need to reformat by code so they are all equal.
I tried doing it like this:
set(gcf,'windowstyle','normal') %undocked the figure
set(gcf,'Position', [1 1 967 700])
a=title('HEllo') %redo the title so I can name it with 'a'
set(a,'Position',[ 0.3480e3 1.3e3 0.0010e3])
c=xlabel('X')
set(c,'Position',[ 350 -110 1])
d=ylabel('Y')
set(d,'Position',[-86 597 1])
set(gcf,'papersize',[22 18])
set(gcf, 'PaperPosition', [0 -1.75 25 20]);
print -painters -dpdf -r300 test.pdf
I did this for two plots but somehow one is bigger than the other... You can check the .pdf attached. Can someone explain me or tell me how I can correct it?
Many thanks!

Answers (0)

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!