1 |
% |
2 |
% SUBFCT_MAPCLEAN(CPLOT,CBAR) |
3 |
% |
4 |
% This function makes uniformed subplots (handles CPLOT) |
5 |
% and their vertical colorbars (handles CBAR) |
6 |
% |
7 |
% 07/06/06 |
8 |
% gmaze@mit.edu |
9 |
|
10 |
function subfct_mapclean(CPLOT,CBAR) |
11 |
|
12 |
|
13 |
np = length(CPLOT); |
14 |
proper1 = 'position'; |
15 |
proper2 = 'position'; |
16 |
|
17 |
% Get positions of subplots and colorbars: |
18 |
for ip = 1 : np |
19 |
Pot(ip,:) = get(CPLOT(ip),proper1); |
20 |
Bot(ip,:) = get(CBAR(ip),proper2); |
21 |
end |
22 |
|
23 |
|
24 |
% Set coord of subplots: [left bottom width height] |
25 |
W = max(Pot(:,3)); |
26 |
H = max(Pot(:,4)); |
27 |
Pot; |
28 |
for ip = 1 : np |
29 |
set(CPLOT(ip),proper1,[Pot(ip,1:2) W H]); |
30 |
end |
31 |
|
32 |
|
33 |
% Get new positions of subplots: |
34 |
for ip = 1 : np |
35 |
Pot(ip,:) = get(CPLOT(ip),proper1); |
36 |
end |
37 |
|
38 |
|
39 |
% Fixe colorbars coord: [left bottom width height] |
40 |
Wmin = 0.0435*min(Pot(:,3)); |
41 |
Hmin = 0.6*min(Pot(:,4)); |
42 |
|
43 |
% Set them: |
44 |
for ip = 1 : np |
45 |
%set(CBAR(ip),proper2,[Bot(ip,1) Bot(ip,2) Wmin Hmin]); |
46 |
% set(CBAR(ip),proper2,[Pot(ip,1)+Pot(ip,3)*1.1 Pot(ip,2)+Pot(ip,2)*0.1 Wmin Hmin]); |
47 |
set(CBAR(ip),proper2,[Pot(ip,1)+Pot(ip,3)*1.05 Pot(ip,2)+Pot(ip,4)*0.2 ... |
48 |
0.0435*Pot(ip,3) 0.6*Pot(ip,4)]) |
49 |
end |