/[MITgcm]/MITgcm_contrib/atnguyen/verification/lab_sea/matlab/seismic.m
ViewVC logotype

Contents of /MITgcm_contrib/atnguyen/verification/lab_sea/matlab/seismic.m

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


Revision 1.1 - (show annotations) (download)
Mon Jun 1 23:25:15 2015 UTC (10 years, 2 months ago) by atn
Branch: MAIN
CVS Tags: HEAD
matlab routines to analyze latest seaice thermo adjoint using IFenty code

1 function rgb = seismic(n);
2
3 % seismic(n) creates a colormap, ranging from dark blue via white to dark red.
4 %
5 % Nico Sneeuw
6 % Munich, 31/08/94
7
8 if nargin == 0, n = size(get(gcf,'colormap'),1); end
9
10 m = ceil(n/3);
11 top = ones(m,1);
12 bot = zeros(m,1);
13 up = (0:m-1)'/m;
14 down = flipud(up);
15
16 r = [bot; up; 1; top; down];
17 g = [bot; up; 1; down; bot];
18 b = [up; top; 1; down; bot];
19 rgb = [r g b];
20
21 % rgb-map has size 4m+1 now. The central part will be extracted.
22
23 xlarge = 4*m+1-n;
24 xblue = round(xlarge/2);
25 xred = xlarge - xblue;
26 rgb([1:xblue 4*m-xred+2:4*m+1],:) = [];

  ViewVC Help
Powered by ViewVC 1.1.22