What does this code mean? set(gcf, 'units','normalized','outerposition',[0 0 1 1]);
显示 更早的评论
What does this code mean?
set(gcf, 'units','normalized','outerposition',[0 0 1 1]);
7 个评论
@Teemu: All your questions have the same body ";". Please stop this, because all other users of this forum show, how to post a question in a clear and understandable manner. Use a short title and insert the question in the body. This would help to support the quality of the forum. Thanks.
Or has there been a question and you have deleted it after you got an answer?!
Image Analyst
2013-2-12
If I remember, I won't bother to answer any questions from Teemu anymore.
Jan
2013-2-12
@Sean and Azzi: Has there been a question at first or is this only a strange layout idea of Teemu?
Sean de Wolski
2013-2-12
@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
2013-2-12
@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.
sipsj11
2017-12-13
In the new MATLAB you'll need to set figure size by the code below, the previous syntax no longer works
fig=gcf;
fig.Units='normalized';
fig.OuterPosition=[0 0 1 1];
Steven Lord
2017-12-13
That's not correct, sipsj11. The newer [object].[property] syntax will not work in older (pre-R2014b) releases of MATLAB, but the older set-based syntax will work in older and newer releases.
采纳的回答
更多回答(1 个)
Azzi Abdelmalek
2013-2-12
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]);
6 个评论
Azzi Abdelmalek
2013-2-12
to get all figure properties type in command windows
set(gcf)
Sean de Wolski
2013-2-12
@Azzi, not completely true:
get(gcf) %shows all properties
set(gcf) %shows only user-settable properties
Azzi Abdelmalek
2013-2-12
编辑:Azzi Abdelmalek
2013-2-12
by all, I meant all user-settable properties. That's what is needed in his case
Teemu
2013-2-12
Milena Parada
2016-10-8
How could works outer positions for subplots? How can I fix double x axis scale ? How can I know the position for each subplot?
Walter Roberson
2016-10-8
MATLAB does not care whether an axes was generated with subplot(): you can still get the axes OuterPosition or Position property.
If you want to know position of each subplot, then set the Units for each of the axes to Pixels, and then the Position properties can be compared easily.
类别
在 帮助中心 和 File Exchange 中查找有关 Creating, Deleting, and Querying Graphics Objects 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!