summaryrefslogtreecommitdiffstats
path: root/SD-VBS/common/toolbox/toolbox_basic/stella/openfigure.m
diff options
context:
space:
mode:
Diffstat (limited to 'SD-VBS/common/toolbox/toolbox_basic/stella/openfigure.m')
-rwxr-xr-xSD-VBS/common/toolbox/toolbox_basic/stella/openfigure.m52
1 files changed, 52 insertions, 0 deletions
diff --git a/SD-VBS/common/toolbox/toolbox_basic/stella/openfigure.m b/SD-VBS/common/toolbox/toolbox_basic/stella/openfigure.m
new file mode 100755
index 0000000..e677014
--- /dev/null
+++ b/SD-VBS/common/toolbox/toolbox_basic/stella/openfigure.m
@@ -0,0 +1,52 @@
1% function openfigure(m,n,caption,isnew)
2function h = openfigure(m,n,caption,isnew)
3
4if nargin<3,
5 caption = ' ';
6end
7
8if nargin<4,
9 isnew = 1;
10end
11
12if (m<=0 | n<=0)
13 return;
14end
15
16if isnew,
17 h = figure; colormap(gray);
18else
19 h = gcf;
20end
21clf
22
23subplot('position',[0,0,0.1,0.1]); axis off;
24text(0.1,0.15,sprintf('S. X. Yu, %s',date),'FontSize',8);
25
26subplot('position',[0,0.96,0.1,0.1]); axis off;
27text(0.1,0.15,caption,'FontSize',8);
28
29subplot(m,n,1);
30%return
31
32if (m==1 & n==1),
33 return;
34end
35
36%set(gcf,'PaperPosition',[0.25, 8, 8,2.5*m]);
37% set(gcf,'PaperPosition',[0.25,0.25,8,10.5]);
38%return
39
40if (m<=n),
41 set(gcf,'PaperOrientation','landscape','PaperPosition',[0.25,0.25,10.5,8]);
42else
43 set(gcf,'PaperPosition',[0.25,0.25,8,10.5]);
44end
45
46% comment on PaperPosition
47% [a,b,c,d]
48% (a,b) is the coordinate of the lower-left corner of the figure
49% (a,b) = (0,0) is the lower-left corner of the paper
50% (c,d) is the coordinate of the upper-right corner of the figure relative to the lower-left corner of the figure
51% Therefore, c>=a, d>=b
52% Full paper position would be [0,0,8.5,11] in inches