-
Notifications
You must be signed in to change notification settings - Fork 0
/
fPlaceFig.m
executable file
·31 lines (31 loc) · 1.11 KB
/
fPlaceFig.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
function NewPos = fPlaceFig(hFig,mode)
Pos = get(0,'ScreenSize');
switch(mode)
case 'small'
NewPos = [Pos(1)+0.4*Pos(3) Pos(2)+0.425*Pos(4) Pos(3)*0.2 Pos(4)*0.15];
if NewPos(3)<300
NewPos(3)=300;
end
if NewPos(4)<100
NewPos(4)=100;
end
case 'medium'
NewPos = [Pos(1)+0.6*Pos(3) Pos(2)+0.05*Pos(4) Pos(3)*0.35 Pos(4)*0.5];
case 'big'
NewPos = [Pos(1)+0.05*Pos(3) Pos(2)+0.03*Pos(4) Pos(3)*0.65 Pos(4)*0.92];
case 'bigger'
NewPos = [Pos(1)+0.05*Pos(3) Pos(2)+0.05*Pos(4) Pos(3)*0.9 Pos(4)*0.92];
case 'speed'
NewPos = [Pos(1)+0.4*Pos(3) Pos(2)+0.3*Pos(4) Pos(3)*0.2 Pos(4)*0.3];
case 'export'
NewPos = [Pos(1)+0.65*Pos(3) Pos(2)+0.15*Pos(4) Pos(3)*0.35 Pos(4)*0.7];
case 'reposition'
set(hFig,'Units','pixels');
PosFig = get(hFig,'Position');
NewPos = [Pos(1)+0.5*(Pos(3)-PosFig(3)) Pos(2)+0.5*(Pos(4)-PosFig(4)) PosFig(3) PosFig(4)];
end
if ~isempty(hFig)
set(hFig,'Units','pixels');
set(hFig,'Position',NewPos);
set(hFig,'Units','normalized','Visible','on');
end