MATLAB Answers


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]);


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?

@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.



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


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


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


@Azzi, not completely true:

get(gcf)  %shows all properties
set(gcf)  %shows only user-settable properties

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

on 12 Feb 2013

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

Join the 15-year community celebration.

Play games and win prizes!

Learn more
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

MATLAB Academy

New to MATLAB?

Learn MATLAB today!