/[MITgcm]/MITgcm/verification/tutorial_global_oce_latlon/diags_matlab/jet0.m
ViewVC logotype

Annotation of /MITgcm/verification/tutorial_global_oce_latlon/diags_matlab/jet0.m

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


Revision 1.1 - (hide annotations) (download)
Sat Aug 12 19:37:25 2006 UTC (17 years, 10 months ago) by jmc
Branch: MAIN
moved from verification/global_ocean.90x40x15/diags_matlab ;
 add Header and Name; use "quiver" instead of NaNquiver (<- not standard);

1 jmc 1.1 function J = jet0(m)
2     %JET0 Variant of JET.
3     % JET0(M), a variant of JET(M), is the colormap used with the
4     % NCSA fluid jet image, but with the central colors set to white.
5     % JET0, by itself, is the same length as the current colormap.
6     % Use COLORMAP(JET0).
7     %
8     % See also JET, HSV, HOT, PINK, FLAG, COLORMAP, RGBPLOT.
9    
10     % taken from jet.m, Martin Losch, 3-8-02
11     % C. B. Moler, 5-10-91, 8-19-92.
12     % Copyright 1984-2001 The MathWorks, Inc.
13     % $Revision: 1.1 $ $Date: 2002/10/22 13:30:40 $
14     % $Header: $
15     % $Name: $
16    
17     if nargin < 1, m = size(get(gcf,'colormap'),1); end
18     n = max(round(m/4),1);
19     x = (1:n)'/n;
20     y = (n/2:n)'/n;
21     e = ones(length(x),1);
22     r = [0*y; 0*e; x; e; flipud(y)];
23     g = [0*y; x; e; flipud(x); 0*y];
24     b = [y; e; flipud(x); 0*e; 0*y];
25     J = [r g b];
26     while size(J,1) > m
27     J(1,:) = [];
28     if size(J,1) > m, J(size(J,1),:) = []; end
29     end
30     % set central colors to white
31     if mod(m,2)
32     ic = ceil(m/2);
33     J(ic-1:ic+1,:) = ones(3,3);
34     else
35     J(m/2:m/2+1,:) = ones(2,3);
36     end

  ViewVC Help
Powered by ViewVC 1.1.22