Warning, /verification/tutorial_global_oce_latlon/diags_matlab/jet0.m is written in an unsupported language. File is not indexed.
view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
051ee7f715 Jean*0001 function J = jet0(m)
0002 %JET0 Variant of JET.
0003 % JET0(M), a variant of JET(M), is the colormap used with the
0004 % NCSA fluid jet image, but with the central colors set to white.
0005 % JET0, by itself, is the same length as the current colormap.
0006 % Use COLORMAP(JET0).
0007 %
0008 % See also JET, HSV, HOT, PINK, FLAG, COLORMAP, RGBPLOT.
0009
0010 % taken from jet.m, Martin Losch, 3-8-02
0011 % C. B. Moler, 5-10-91, 8-19-92.
0012 % Copyright 1984-2001 The MathWorks, Inc.
0013 if nargin < 1, m = size(get(gcf,'colormap'),1); end
0014 n = max(round(m/4),1);
0015 x = (1:n)'/n;
0016 y = (n/2:n)'/n;
0017 e = ones(length(x),1);
0018 r = [0*y; 0*e; x; e; flipud(y)];
0019 g = [0*y; x; e; flipud(x); 0*y];
0020 b = [y; e; flipud(x); 0*e; 0*y];
0021 J = [r g b];
0022 while size(J,1) > m
0023 J(1,:) = [];
0024 if size(J,1) > m, J(size(J,1),:) = []; end
0025 end
0026 % set central colors to white
0027 if mod(m,2)
0028 ic = ceil(m/2);
0029 J(ic-1:ic+1,:) = ones(3,3);
0030 else
0031 J(m/2:m/2+1,:) = ones(2,3);
0032 end