-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjet2.m
More file actions
executable file
·43 lines (39 loc) · 845 Bytes
/
Copy pathjet2.m
File metadata and controls
executable file
·43 lines (39 loc) · 845 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
function cmap = jet2(m)
% Jet colormap with added fade to black
% Copyright 2010 The Mathworks, Inc.
% $Revision: 1$
% $Date: 2010-11-08$
if nargin < 1
m = size(get(gcf,'colormap'),1);
end
% A list of break-point colors
colors = [
0.0 0.0 0.5
0.0 0.0 1.0
0.0 0.5 1.0
0.0 1.0 1.0
0.5 1.0 0.5
1.0 1.0 0.0
1.0 0.5 0.0
1.0 0.0 0.0
0.5 0.0 0.0
0.5 0.0 0.0
1.0 0.0 0.0
1.0 0.5 0.0
1.0 1.0 0.0
0.5 1.0 0.5
0.0 1.0 1.0
0.0 0.5 1.0
0.0 0.0 1.0
0.0 0.0 0.5
0.0 0.0 0.0
];
% Now work out the indices into the map
N = size( colors, 1 );
idxIn = 1:N;
idxOut = linspace( 1, N, m );
cmap = [
interp1( idxIn, colors(:,1), idxOut )
interp1( idxIn, colors(:,2), idxOut )
interp1( idxIn, colors(:,3), idxOut )
]';