Mercurial > hg > octave-lyh
comparison scripts/image/jet.m @ 11587:c792872f8942
all script files: untabify and strip trailing whitespace
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 20 Jan 2011 17:35:29 -0500 |
parents | fd0a3ac60b0e |
children | 72c96de7a403 |
comparison
equal
deleted
inserted
replaced
11586:12df7854fa7c | 11587:c792872f8942 |
---|---|
18 | 18 |
19 ## -*- texinfo -*- | 19 ## -*- texinfo -*- |
20 ## @deftypefn {Function File} {@var{map} =} jet () | 20 ## @deftypefn {Function File} {@var{map} =} jet () |
21 ## @deftypefnx {Function File} {@var{map} =} jet (@var{n}) | 21 ## @deftypefnx {Function File} {@var{map} =} jet (@var{n}) |
22 ## Create color colormap. This colormap ranges from dark blue through blue, | 22 ## Create color colormap. This colormap ranges from dark blue through blue, |
23 ## cyan, green, yellow, red, to dark red. | 23 ## cyan, green, yellow, red, to dark red. |
24 ## The argument @var{n} must be a scalar. | 24 ## The argument @var{n} must be a scalar. |
25 ## If unspecified, the length of the current colormap, or 64, is used. | 25 ## If unspecified, the length of the current colormap, or 64, is used. |
26 ## @seealso{colormap} | 26 ## @seealso{colormap} |
27 ## @end deftypefn | 27 ## @end deftypefn |
28 | 28 |
29 ## Author: Kai Habel <kai.habel@gmx.de> | 29 ## Author: Kai Habel <kai.habel@gmx.de> |
39 else | 39 else |
40 print_usage (); | 40 print_usage (); |
41 endif | 41 endif |
42 | 42 |
43 if (n == 1) | 43 if (n == 1) |
44 map = [0, 0, 0.5]; | 44 map = [0, 0, 0.5]; |
45 elseif (n > 1) | 45 elseif (n > 1) |
46 x = linspace(0, 1, n)'; | 46 x = linspace(0, 1, n)'; |
47 r = (x >= 3/8 & x < 5/8) .* (4 * x - 3/2)\ | 47 r = (x >= 3/8 & x < 5/8) .* (4 * x - 3/2)\ |
48 + (x >= 5/8 & x < 7/8) + (x >= 7/8) .* (-4 * x + 9/2); | 48 + (x >= 5/8 & x < 7/8) + (x >= 7/8) .* (-4 * x + 9/2); |
49 g = (x >= 1/8 & x < 3/8) .* (4 * x - 1/2)\ | 49 g = (x >= 1/8 & x < 3/8) .* (4 * x - 1/2)\ |