3

I am using the following code in Matlab

figure mesh(AAA,BBB,ZZZ) set(gcf,'Position', [560 528 560*2 420*(1/2)]) colorbar print -depsc2 -painters XXX.eps 

However, the following line:

set(gcf,'Position', [560 528 560*2 420*(1/2)]) 

does not seem to have any influence on the output file. Thus, how can I specify the dimensions of the output file?

0

1 Answer 1

3

You need to set the 'Paperposition' property of the figure (not 'Position'):

set(gcf,'Paperposition',[left bottom width height]); 

The numbers left, bottom etc are in units determined by the 'PaperUnits' property, which can also be modified.

Sign up to request clarification or add additional context in comments.

2 Comments

To which Matlab version does this apply? I can't seem to find any details. Maybe that is an indication that it applies to all....?
@kkuilla I think I remember very old Matlab versions that already had that property, but I'm not sure

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.