Automatically set figure position for multiple figures

Hey guys,
is it possible to fix the position of the figures for multiple figures?
I am looking for a command as
set(0, 'DefaultFigurePosition', Pos);
but for multiple windows.
Thanks in advance

2 件のコメント

Joep
Joep 2015 年 11 月 26 日
All in once? or separate?
I should say just
h1=figure %figure1
h2=figure %figure1
set(h1, 'Position', Pos);
set(h2, 'Position', Pos);
U mean like this?
Titus Edelhofer
Titus Edelhofer 2015 年 11 月 26 日
Hi, sorry, I don't understand. Are those figures already open? In this case use
get(0, 'children')
to access an array of all available figures.
Titus

サインインしてコメントする。

回答 (1 件)

sanderos
sanderos 2015 年 11 月 26 日
編集済み: sanderos 2015 年 11 月 26 日

1 投票

Thanks, my question was not specific enough.
I have a script that I run, depending on the computer, to fix the default figure position.
function SetFigPosition(Setting)
% get current figure
% get(gcf, 'Position')
close all;
if Setting == 1 % main screen, upper right side
Pos = [795 359 798 457];
elseif Setting == 2 % main screen, total right side
Pos = [809 39 784 777];
elseif Setting == 3 % second screen, large size
Pos = [1879 -155 1631 971];
elseif Setting == 4 % second screen, middle size
figure(1)
Pos = [2651 214 859 602];
elseif Setting == 5 % main screen, large size, small height
figure(1)
Pos = [10 318 1583 498];
elseif Setting == 6 % second screen, large size, small height
figure(1)
Pos = [1666 266 1729 464];
else
error('This setting is not defined')
end
set(0, 'DefaultFigurePosition', Pos);
% set(1, 'DefaultFigurePosition', Pos);
figure
pause(1); close all;
However, this script is valid for one figure only. If two figures are opened they are just superposed. As I usually work with two or three seperate figures I would like to fix the default behaviour for each figure.

カテゴリ

ヘルプ センター および File ExchangeGraphics Performance についてさらに検索

質問済み:

2015 年 11 月 26 日

編集済み:

2015 年 11 月 26 日

Community Treasure Hunt

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

Start Hunting!

Translated by