/[MITgcm]/MITgcm_contrib/high_res_cube/eddy_flux/scalHV_colbar.m
ViewVC logotype

Annotation of /MITgcm_contrib/high_res_cube/eddy_flux/scalHV_colbar.m

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (hide annotations) (download)
Tue May 18 01:53:31 2004 UTC (21 years, 2 months ago) by edhill
Branch: MAIN
 o initial check-in

1 edhill 1.1 function scalHV_colbar(barscale,ori_h0v1)
2     % scalHV_colbar(barscale,[ori_h0v1])
3     % Draw Horizontal(default) or Vertical (ori_h0v1=1) Colorbar
4     % with scale factor given by barscale
5     % e.g.: barscale=[0.8 0.7] --> shift to center AND reduce by 0.2 in H & 0.3 in V
6     % e.g.: barscale=[1. .7 .6 .5] --> shift to center by 0.3 in V
7     % AND reduce by 0.4 in H & 0.5 in V
8     if (nargin < 2), ori_h0v1 = 0; end
9     %---
10     barfac=barscale;
11     if size(barscale,2) < 2, barfac(2)=barfac(1) ; end
12     if size(barscale,2) < 3, barfac(3)=barfac(1) ; end
13     if size(barscale,2) < 4, barfac(4)=barfac(2) ; end
14     %---
15     if ori_h0v1 == 1
16     BB=colorbar('vertical') ;
17     else
18     BB=colorbar('horiz') ;
19     end
20     pos=get(BB,'position') ;
21     %fprintf(' -- initial colorbar position : %6.4f %6.4f %6.4f %6.4f \n', pos);
22     pos(1) = (0.5-pos(1)-pos(3)*0.5)*barfac(1) ;
23     pos(2) = (0.5-pos(2)-pos(4)*0.5)*barfac(2) ;
24     pos(3) = pos(3)*barfac(3) ;
25     pos(4) = pos(4)*barfac(4) ;
26     pos(1) = 0.5-pos(1)-pos(3)*0.5 ;
27     pos(2) = 0.5-pos(2)-pos(4)*0.5 ;
28     %fprintf(' - modified colorbar position : %6.4f %6.4f %6.4f %6.4f \n', pos);
29     set(BB,'position',pos);
30     return

  ViewVC Help
Powered by ViewVC 1.1.22