1 | function showregion(md,insetpos)
|
---|
2 | global ISSM_DIR
|
---|
3 |
|
---|
4 | %get inset relative position (x,y,width,height)
|
---|
5 | %insetpos=getfieldvalue(options,'insetpos',[0.02 0.70 0.18 0.18]);
|
---|
6 |
|
---|
7 | %get current plos position
|
---|
8 | cplotpos=get(gca,'pos');
|
---|
9 | %compute inset position
|
---|
10 | PosInset=[cplotpos(1)+insetpos(1)*cplotpos(3),cplotpos(2)+insetpos(2)*cplotpos(4), insetpos(3)*cplotpos(3), insetpos(4)*cplotpos(4)];
|
---|
11 | axes('pos',PosInset);
|
---|
12 | axis equal off
|
---|
13 | %box off
|
---|
14 | if strcmpi(md.hemisphere,'n') | strcmpi(md.hemisphere,'north'),
|
---|
15 | A=expread([ ISSM_DIR 'projects/Exp/Greenland.exp']);
|
---|
16 | elseif strcmpi(md.hemisphere,'s') | strcmpi(md.hemisphere,'south'),
|
---|
17 | A=expread([ ISSM_DIR '/projects/Exp/Antarctica.exp']);
|
---|
18 | else
|
---|
19 | error('applyoptions error message: hemisphere not defined');
|
---|
20 | end
|
---|
21 |
|
---|
22 | Ax=[min(A.x) max(A.x)];
|
---|
23 | Ay=[min(A.y) max(A.y)];
|
---|
24 |
|
---|
25 | mdx=[min(md.x) max(md.x)];
|
---|
26 | mdy=[min(md.y) max(md.y)];
|
---|
27 |
|
---|
28 | line(A.x,A.y,'color','b');
|
---|
29 | patch([Ax(1) Ax(2) Ax(2) Ax(1) Ax(1)],[Ay(1) Ay(1) Ay(2) Ay(2) Ay(1)],[1 1 1],'EdgeColor',[0 0 0],'LineWidth',1,'FaceLighting','none')
|
---|
30 | patch( [mdx(1) mdx(2) mdx(2) mdx(1)],[mdy(1) mdy(1) mdy(2) mdy(2)],ones(4,1),'EdgeColor',[0 0 0],'FaceColor','r','FaceAlpha',0.5)
|
---|
31 | colorbar('off');
|
---|