Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

To resolve issues starting MATLAB on Mac OS X 10.10 (Yosemite) visit: http://www.mathworks.com/matlabcentral/answers/159016

What does this code mean? set(gcf, 'units','n​ormalized'​,'outerpos​ition',[0 0 1 1]);

Asked by Teemu on 12 Feb 2013

What does this code mean?

set(gcf, 'units','normalized','outerposition',[0 0 1 1]);

5 Comments

Jan Simon on 12 Feb 2013

@Sean and Azzi: Has there been a question at first or is this only a strange layout idea of Teemu?

Sean de Wolski on 12 Feb 2013

@Jan, The question is in the title; frankly I like this format well enough. I know exactly what I'm getting into before clicking on anything.

Jan Simon on 12 Feb 2013

@Sean: Thanks. Perhaps this style is more convenient, when someony is used to read tweeds or rss feeds. I am so happy with the power to format code, in comparison to CSSM, that I do not like the just-title style.

Teemu

Tags

Products

No products are associated with this question.

2 Answers

Answer by Sean de Wolski on 12 Feb 2013
Accepted answer

Set ( set ) the current figure ( gcf ) to have 'Units' be 'normalized' and the 'outerposition', i.e. the actual borders of the figure to be at the bottom left corner (0,0) and span the whole screen (1,1).

Of you could just run it :)

And look at the doc:

doc set
doc figure %click on figure properties

0 Comments

Sean de Wolski
Answer by Azzi Abdelmalek on 12 Feb 2013
set(gcf, 'units','normalized','outerposition',[0 0 1 1]);

% 'units','normalized' : the unit can be

Units: [ inches | centimeters | normalized | points | {pixels} | characters ]

'outerposition',[0 0 1 1]); the position of your figure [x0,y0,width,height] for normalized unit the min is 0 and the max is 1

try

set(gcf, 'units','centimeters','outerposition',[0 0 20 10]);

4 Comments

Sean de Wolski on 12 Feb 2013

@Azzi, not completely true:

get(gcf)  %shows all properties
set(gcf)  %shows only user-settable properties
Azzi Abdelmalek on 12 Feb 2013

by all, I meant all user-settable properties. That's what is needed in his case

Teemu on 12 Feb 2013

now I understand the meaning of that and I know how to use it. Thanks for you answers!

Azzi Abdelmalek

Contact us