home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l460 / 2.ddi / COLOR.DI$ / HOT.M < prev    next >
Encoding:
Text File  |  1993-03-07  |  658 b   |  24 lines

  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 colormap.
  5. %
  6. %    For example, to reset the colormap of the current figure:
  7. %
  8. %              colormap(hot)
  9. %
  10. %    See also HSV, GRAY, PINK, COOL, BONE, COPPER, FLAG, 
  11. %    COLORMAP, RGBPLOT.
  12.  
  13. %    C. Moler, 8-17-88, 5-11-91, 8-19-92.
  14. %    Copyright (c) 1984-93 by The MathWorks, Inc.
  15.  
  16. if nargin < 1, m = size(get(gcf,'colormap'),1); end
  17. n = fix(3/8*m);
  18.  
  19. r = [(1:n)'/n; ones(m-n,1)];
  20. g = [zeros(n,1); (1:n)'/n; ones(m-2*n,1)];
  21. b = [zeros(2*n,1); (1:m-2*n)'/(m-2*n)];
  22.  
  23. h = [r g b];
  24.