Mercurial > octave
annotate scripts/image/cubehelix.m @ 33596:96a203bc7e17 bytecode-interpreter tip
maint: Merge default to bytecode-interpreter
author | Nicholas R. Jankowski <jankowski.nicholas@gmail.com> |
---|---|
date | Fri, 17 May 2024 22:49:58 -0400 |
parents | d8e5e55c3cf5 |
children |
rev | line source |
---|---|
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
1 ######################################################################## |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
2 ## |
32632
2e484f9f1f18
maint: update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
31706
diff
changeset
|
3 ## Copyright (C) 2014-2024 The Octave Project Developers |
27918
b442ec6dda5c
use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents:
27800
diff
changeset
|
4 ## |
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
5 ## See the file COPYRIGHT.md in the top-level directory of this |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
6 ## distribution or <https://octave.org/copyright/>. |
19530
5ab6fcf32d1e
New function for colormap cubehelix.
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
7 ## |
5ab6fcf32d1e
New function for colormap cubehelix.
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
8 ## This file is part of Octave. |
5ab6fcf32d1e
New function for colormap cubehelix.
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
9 ## |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
10 ## Octave is free software: you can redistribute it and/or modify it |
19530
5ab6fcf32d1e
New function for colormap cubehelix.
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
11 ## under the terms of the GNU General Public License as published by |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
12 ## the Free Software Foundation, either version 3 of the License, or |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
13 ## (at your option) any later version. |
19530
5ab6fcf32d1e
New function for colormap cubehelix.
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
14 ## |
5ab6fcf32d1e
New function for colormap cubehelix.
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
15 ## Octave is distributed in the hope that it will be useful, but |
5ab6fcf32d1e
New function for colormap cubehelix.
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
16 ## WITHOUT ANY WARRANTY; without even the implied warranty of |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
17 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
18 ## GNU General Public License for more details. |
19530
5ab6fcf32d1e
New function for colormap cubehelix.
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
19 ## |
5ab6fcf32d1e
New function for colormap cubehelix.
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
20 ## You should have received a copy of the GNU General Public License |
5ab6fcf32d1e
New function for colormap cubehelix.
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
21 ## along with Octave; see the file COPYING. If not, see |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
22 ## <https://www.gnu.org/licenses/>. |
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
23 ## |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
24 ######################################################################## |
19530
5ab6fcf32d1e
New function for colormap cubehelix.
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
25 |
5ab6fcf32d1e
New function for colormap cubehelix.
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
26 ## -*- texinfo -*- |
20852
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
20724
diff
changeset
|
27 ## @deftypefn {} {@var{map} =} cubehelix () |
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
20724
diff
changeset
|
28 ## @deftypefnx {} {@var{map} =} cubehelix (@var{n}) |
28948
36cd3569f702
maint: match names in documentation and input parameters in function.
Rik <rik@octave.org>
parents:
28789
diff
changeset
|
29 ## @deftypefnx {} {@var{map} =} cubehelix (@var{n}, @var{start}, @var{rots}, @var{hue}, @var{gamma}) |
19530
5ab6fcf32d1e
New function for colormap cubehelix.
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
30 ## Create cubehelix colormap. |
5ab6fcf32d1e
New function for colormap cubehelix.
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
31 ## |
5ab6fcf32d1e
New function for colormap cubehelix.
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
32 ## This colormap varies from black to white going though blue, green, and red |
5ab6fcf32d1e
New function for colormap cubehelix.
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
33 ## tones while maintaining a monotonically increasing perception of intensity. |
21315
ea2c2e08ceda
doc: Periodic spellcheck of documentation.
Rik <rik@octave.org>
parents:
20852
diff
changeset
|
34 ## This is achieved by traversing a color cube from black to white through |
19530
5ab6fcf32d1e
New function for colormap cubehelix.
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
35 ## a helix, hence the name cubehelix, while taking into account the perceived |
5ab6fcf32d1e
New function for colormap cubehelix.
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
36 ## brightness of each channel according to the NTSC specifications from 1953. |
5ab6fcf32d1e
New function for colormap cubehelix.
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
37 ## |
5ab6fcf32d1e
New function for colormap cubehelix.
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
38 ## @example |
5ab6fcf32d1e
New function for colormap cubehelix.
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
39 ## rgbplot (cubehelix (256)) |
5ab6fcf32d1e
New function for colormap cubehelix.
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
40 ## @end example |
5ab6fcf32d1e
New function for colormap cubehelix.
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
41 ## |
20158
7503499a252b
doc: Update docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
20098
diff
changeset
|
42 ## The argument @var{n} must be a scalar. |
32647
dfb9b770ae77
Increase default colormap size to 256 colors, add colormap BISTs (bug #65010)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32632
diff
changeset
|
43 ## If @var{n} is not specified the length of the current colormap is used. If |
dfb9b770ae77
Increase default colormap size to 256 colors, add colormap BISTs (bug #65010)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32632
diff
changeset
|
44 ## there is no current colormap the default value of 256 is used. |
19530
5ab6fcf32d1e
New function for colormap cubehelix.
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
45 ## |
20158
7503499a252b
doc: Update docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
20098
diff
changeset
|
46 ## Reference: Green, D. A., 2011, |
27800
5a6a19a4e3da
doc: Use Texinfo non-sentence ending periods in citations.
Rik <rik@octave.org>
parents:
26376
diff
changeset
|
47 ## @cite{A @nospell{colour} scheme for the display of astronomical intensity |
5a6a19a4e3da
doc: Use Texinfo non-sentence ending periods in citations.
Rik <rik@octave.org>
parents:
26376
diff
changeset
|
48 ## images}, Bulletin of the Astronomical Society of India, 39, 289. |
19530
5ab6fcf32d1e
New function for colormap cubehelix.
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
49 ## |
5ab6fcf32d1e
New function for colormap cubehelix.
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
50 ## @seealso{colormap} |
5ab6fcf32d1e
New function for colormap cubehelix.
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
51 ## @end deftypefn |
5ab6fcf32d1e
New function for colormap cubehelix.
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
52 |
24800
2dc04b6e1740
Don't create new figure when calling colormap functions (bug #53217).
Rik <rik@octave.org>
parents:
24534
diff
changeset
|
53 function map = cubehelix (n, start = 0.5, rots = -1.5, hue = 1, gamma = 1) |
19530
5ab6fcf32d1e
New function for colormap cubehelix.
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
54 |
28789
28de41192f3c
Eliminate unneeded verification of nargin, nargout in m-files.
Rik <rik@octave.org>
parents:
27978
diff
changeset
|
55 if (nargin > 0) |
32737
d8e5e55c3cf5
Tighten input validation for all colormaps (bug #65011).
Rik <rik@octave.org>
parents:
32653
diff
changeset
|
56 if (! (isscalar (n) && isreal (n) && n == fix (n))) |
d8e5e55c3cf5
Tighten input validation for all colormaps (bug #65011).
Rik <rik@octave.org>
parents:
32653
diff
changeset
|
57 error ("cubehelix: N must be a scalar integer"); |
24800
2dc04b6e1740
Don't create new figure when calling colormap functions (bug #53217).
Rik <rik@octave.org>
parents:
24534
diff
changeset
|
58 endif |
2dc04b6e1740
Don't create new figure when calling colormap functions (bug #53217).
Rik <rik@octave.org>
parents:
24534
diff
changeset
|
59 n = double (n); |
2dc04b6e1740
Don't create new figure when calling colormap functions (bug #53217).
Rik <rik@octave.org>
parents:
24534
diff
changeset
|
60 else |
2dc04b6e1740
Don't create new figure when calling colormap functions (bug #53217).
Rik <rik@octave.org>
parents:
24534
diff
changeset
|
61 hf = get (0, "currentfigure"); |
2dc04b6e1740
Don't create new figure when calling colormap functions (bug #53217).
Rik <rik@octave.org>
parents:
24534
diff
changeset
|
62 if (! isempty (hf)) |
2dc04b6e1740
Don't create new figure when calling colormap functions (bug #53217).
Rik <rik@octave.org>
parents:
24534
diff
changeset
|
63 n = rows (get (hf, "colormap")); |
2dc04b6e1740
Don't create new figure when calling colormap functions (bug #53217).
Rik <rik@octave.org>
parents:
24534
diff
changeset
|
64 else |
32647
dfb9b770ae77
Increase default colormap size to 256 colors, add colormap BISTs (bug #65010)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32632
diff
changeset
|
65 n = 256; |
24800
2dc04b6e1740
Don't create new figure when calling colormap functions (bug #53217).
Rik <rik@octave.org>
parents:
24534
diff
changeset
|
66 endif |
19530
5ab6fcf32d1e
New function for colormap cubehelix.
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
67 endif |
21758
ffad2baa90f7
maint: Use newlines to make code more readable.
Rik <rik@octave.org>
parents:
21385
diff
changeset
|
68 |
19611
ed4eeb4314e6
cubehelix: fix for the corner cases when N is 1 or 0.
Carnë Draug <carandraug@octave.org>
parents:
19530
diff
changeset
|
69 if (n > 1) |
ed4eeb4314e6
cubehelix: fix for the corner cases when N is 1 or 0.
Carnë Draug <carandraug@octave.org>
parents:
19530
diff
changeset
|
70 coeff = [ -0.14861 -0.29227 1.97294 |
ed4eeb4314e6
cubehelix: fix for the corner cases when N is 1 or 0.
Carnë Draug <carandraug@octave.org>
parents:
19530
diff
changeset
|
71 1.78277 -0.90649 0.00000]; |
19530
5ab6fcf32d1e
New function for colormap cubehelix.
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
72 |
19611
ed4eeb4314e6
cubehelix: fix for the corner cases when N is 1 or 0.
Carnë Draug <carandraug@octave.org>
parents:
19530
diff
changeset
|
73 fract = ((0:n-1) / (n-1))'; |
ed4eeb4314e6
cubehelix: fix for the corner cases when N is 1 or 0.
Carnë Draug <carandraug@octave.org>
parents:
19530
diff
changeset
|
74 angle = 2 * pi * (start/3 + 1 + rots*fract); |
20231
83792dd9bcc1
Use in-place operators in m-files where possible.
Rik <rik@octave.org>
parents:
20158
diff
changeset
|
75 fract .^= gamma; |
19611
ed4eeb4314e6
cubehelix: fix for the corner cases when N is 1 or 0.
Carnë Draug <carandraug@octave.org>
parents:
19530
diff
changeset
|
76 amp = hue * fract .* (1-fract) /2; |
ed4eeb4314e6
cubehelix: fix for the corner cases when N is 1 or 0.
Carnë Draug <carandraug@octave.org>
parents:
19530
diff
changeset
|
77 map = fract + amp .* ([cos(angle) sin(angle)] * coeff); |
19530
5ab6fcf32d1e
New function for colormap cubehelix.
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
78 |
19611
ed4eeb4314e6
cubehelix: fix for the corner cases when N is 1 or 0.
Carnë Draug <carandraug@octave.org>
parents:
19530
diff
changeset
|
79 ## Clip values (only in case users have changed values of hue or gamma) |
ed4eeb4314e6
cubehelix: fix for the corner cases when N is 1 or 0.
Carnë Draug <carandraug@octave.org>
parents:
19530
diff
changeset
|
80 map(map < 0) = 0; |
ed4eeb4314e6
cubehelix: fix for the corner cases when N is 1 or 0.
Carnë Draug <carandraug@octave.org>
parents:
19530
diff
changeset
|
81 map(map > 1) = 1; |
ed4eeb4314e6
cubehelix: fix for the corner cases when N is 1 or 0.
Carnë Draug <carandraug@octave.org>
parents:
19530
diff
changeset
|
82 elseif (n > 0) |
ed4eeb4314e6
cubehelix: fix for the corner cases when N is 1 or 0.
Carnë Draug <carandraug@octave.org>
parents:
19530
diff
changeset
|
83 map = [0, 0, 0]; |
ed4eeb4314e6
cubehelix: fix for the corner cases when N is 1 or 0.
Carnë Draug <carandraug@octave.org>
parents:
19530
diff
changeset
|
84 else |
ed4eeb4314e6
cubehelix: fix for the corner cases when N is 1 or 0.
Carnë Draug <carandraug@octave.org>
parents:
19530
diff
changeset
|
85 map = zeros (0, 3); |
ed4eeb4314e6
cubehelix: fix for the corner cases when N is 1 or 0.
Carnë Draug <carandraug@octave.org>
parents:
19530
diff
changeset
|
86 endif |
19530
5ab6fcf32d1e
New function for colormap cubehelix.
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
87 |
5ab6fcf32d1e
New function for colormap cubehelix.
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
88 endfunction |
5ab6fcf32d1e
New function for colormap cubehelix.
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
89 |
19833
9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
90 |
31253
a40c0b7aa376
maint: changes to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
30564
diff
changeset
|
91 ## A better demo of this colormap would be a 3-D plot in NTSC instead of |
21758
ffad2baa90f7
maint: Use newlines to make code more readable.
Rik <rik@octave.org>
parents:
21385
diff
changeset
|
92 ## RGB values. That would really show what this colormap is about. |
19530
5ab6fcf32d1e
New function for colormap cubehelix.
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
93 %!demo |
20724
0338dc274ec5
Rewrite colormap demos with rgbplot() to show both composite and profile.
Carnë Draug <carandraug@octave.org>
parents:
20231
diff
changeset
|
94 %! ## Show the 'cubehelix' colormap profile and as an image |
0338dc274ec5
Rewrite colormap demos with rgbplot() to show both composite and profile.
Carnë Draug <carandraug@octave.org>
parents:
20231
diff
changeset
|
95 %! cmap = cubehelix (256); |
0338dc274ec5
Rewrite colormap demos with rgbplot() to show both composite and profile.
Carnë Draug <carandraug@octave.org>
parents:
20231
diff
changeset
|
96 %! subplot (2, 1, 1); |
22302
1c4cd12987f5
Use Octave syntax in graphics demos.
Rik <rik@octave.org>
parents:
21973
diff
changeset
|
97 %! rgbplot (cmap, "composite"); |
20724
0338dc274ec5
Rewrite colormap demos with rgbplot() to show both composite and profile.
Carnë Draug <carandraug@octave.org>
parents:
20231
diff
changeset
|
98 %! subplot (2, 1, 2); |
22302
1c4cd12987f5
Use Octave syntax in graphics demos.
Rik <rik@octave.org>
parents:
21973
diff
changeset
|
99 %! rgbplot (cmap); |
32647
dfb9b770ae77
Increase default colormap size to 256 colors, add colormap BISTs (bug #65010)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32632
diff
changeset
|
100 |
dfb9b770ae77
Increase default colormap size to 256 colors, add colormap BISTs (bug #65010)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32632
diff
changeset
|
101 |
dfb9b770ae77
Increase default colormap size to 256 colors, add colormap BISTs (bug #65010)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32632
diff
changeset
|
102 %!assert (size (cubehelix ()), [256, 3]) |
dfb9b770ae77
Increase default colormap size to 256 colors, add colormap BISTs (bug #65010)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32632
diff
changeset
|
103 %!assert (size (cubehelix (16)), [16, 3]) |
dfb9b770ae77
Increase default colormap size to 256 colors, add colormap BISTs (bug #65010)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32632
diff
changeset
|
104 |
dfb9b770ae77
Increase default colormap size to 256 colors, add colormap BISTs (bug #65010)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32632
diff
changeset
|
105 %!assert (cubehelix (1), [0,0,0]) |
dfb9b770ae77
Increase default colormap size to 256 colors, add colormap BISTs (bug #65010)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32632
diff
changeset
|
106 %!assert (cubehelix (true), double ([0,0,0])) |
dfb9b770ae77
Increase default colormap size to 256 colors, add colormap BISTs (bug #65010)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32632
diff
changeset
|
107 %!assert (cubehelix (char (1)), double ([0,0,0])) |
dfb9b770ae77
Increase default colormap size to 256 colors, add colormap BISTs (bug #65010)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32632
diff
changeset
|
108 %!assert (cubehelix (int32 (1)), double ([0,0,0])) |
dfb9b770ae77
Increase default colormap size to 256 colors, add colormap BISTs (bug #65010)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32632
diff
changeset
|
109 |
dfb9b770ae77
Increase default colormap size to 256 colors, add colormap BISTs (bug #65010)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32632
diff
changeset
|
110 %!assert (cubehelix (0), zeros (0, 3)) |
dfb9b770ae77
Increase default colormap size to 256 colors, add colormap BISTs (bug #65010)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32632
diff
changeset
|
111 %!assert (cubehelix (-1), zeros (0, 3)) |
dfb9b770ae77
Increase default colormap size to 256 colors, add colormap BISTs (bug #65010)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32632
diff
changeset
|
112 |
dfb9b770ae77
Increase default colormap size to 256 colors, add colormap BISTs (bug #65010)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32632
diff
changeset
|
113 %!assert (cubehelix (2), [0, 0, 0; 1, 1, 1]) |
dfb9b770ae77
Increase default colormap size to 256 colors, add colormap BISTs (bug #65010)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32632
diff
changeset
|
114 %!assert ([cubehelix]([1,end],:), [0, 0, 0; 1, 1, 1]) |
dfb9b770ae77
Increase default colormap size to 256 colors, add colormap BISTs (bug #65010)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32632
diff
changeset
|
115 |
dfb9b770ae77
Increase default colormap size to 256 colors, add colormap BISTs (bug #65010)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32632
diff
changeset
|
116 %!shared a |
dfb9b770ae77
Increase default colormap size to 256 colors, add colormap BISTs (bug #65010)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32632
diff
changeset
|
117 %! a = [0, 0, 0; |
dfb9b770ae77
Increase default colormap size to 256 colors, add colormap BISTs (bug #65010)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32632
diff
changeset
|
118 %! 0.17004232121057959, 0.43679759647517287, 0.22372555555555556; |
dfb9b770ae77
Increase default colormap size to 256 colors, add colormap BISTs (bug #65010)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32632
diff
changeset
|
119 %! 0.82995767878942041, 0.56320240352482713, 0.77627444444444445; |
dfb9b770ae77
Increase default colormap size to 256 colors, add colormap BISTs (bug #65010)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32632
diff
changeset
|
120 %! 1, 1, 1]; |
dfb9b770ae77
Increase default colormap size to 256 colors, add colormap BISTs (bug #65010)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32632
diff
changeset
|
121 |
dfb9b770ae77
Increase default colormap size to 256 colors, add colormap BISTs (bug #65010)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32632
diff
changeset
|
122 %!assert (cubehelix (4), a, eps) |
dfb9b770ae77
Increase default colormap size to 256 colors, add colormap BISTs (bug #65010)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32632
diff
changeset
|
123 |
dfb9b770ae77
Increase default colormap size to 256 colors, add colormap BISTs (bug #65010)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32632
diff
changeset
|
124 %!shared # Clear shared varibles to avoid echo on unrelated test errors. |
dfb9b770ae77
Increase default colormap size to 256 colors, add colormap BISTs (bug #65010)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32632
diff
changeset
|
125 |
dfb9b770ae77
Increase default colormap size to 256 colors, add colormap BISTs (bug #65010)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents:
32632
diff
changeset
|
126 ## Input validation |
32737
d8e5e55c3cf5
Tighten input validation for all colormaps (bug #65011).
Rik <rik@octave.org>
parents:
32653
diff
changeset
|
127 %!error <N must be a scalar integer> cubehelix ("foo") |
d8e5e55c3cf5
Tighten input validation for all colormaps (bug #65011).
Rik <rik@octave.org>
parents:
32653
diff
changeset
|
128 %!error <N must be a scalar integer> cubehelix ([1, 2, 3]) |
d8e5e55c3cf5
Tighten input validation for all colormaps (bug #65011).
Rik <rik@octave.org>
parents:
32653
diff
changeset
|
129 %!error <N must be a scalar integer> cubehelix ({1, 2, 3}) |