time | calls | line |
---|
| | 1 | function h = hot(m)
|
| | 2 | %HOT Black-red-yellow-white color map
|
| | 3 | % HOT(M) returns an M-by-3 matrix containing a "hot" colormap.
|
| | 4 | % HOT, by itself, is the same length as the current figure's
|
| | 5 | % colormap. If no figure exists, MATLAB creates one.
|
| | 6 | %
|
| | 7 | % For example, to reset the colormap of the current figure:
|
| | 8 | %
|
| | 9 | % colormap(hot)
|
| | 10 | %
|
| | 11 | % See also HSV, PARULA, GRAY, PINK, COOL, BONE, COPPER, FLAG,
|
| | 12 | % COLORMAP, RGBPLOT.
|
| | 13 |
|
| | 14 | % C. Moler, 8-17-88, 5-11-91, 8-19-92.
|
| | 15 | % Copyright 1984-2004 The MathWorks, Inc.
|
| | 16 |
|
| 16 | 17 | if nargin < 1, m = size(get(gcf,'colormap'),1); end
|
| 16 | 18 | n = fix(3/8*m);
|
| | 19 |
|
| 16 | 20 | r = [(1:n)'/n; ones(m-n,1)];
|
| 16 | 21 | g = [zeros(n,1); (1:n)'/n; ones(m-2*n,1)];
|
| 16 | 22 | b = [zeros(2*n,1); (1:m-2*n)'/(m-2*n)];
|
| | 23 |
|
| 16 | 24 | h = [r g b];
|