1 ## Copyright (C) 2005 Berge-Gladel
3 ## This program is free software; you can redistribute it and/or
4 ## modify it under the terms of the GNU General Public License
5 ## as published by the Free Software Foundation; either version 2
6 ## of the License, or (at your option) any later version.
8 ## This program is distributed in the hope that it will be useful,
9 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
10 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 ## GNU General Public License for more details.
14 ## @deftypefn {Function File} rgbplot (@var{map})
15 ## @deftypefnx{Function File} @var{h} = rgbplot (@var{map})
16 ## Plot a given color map.
17 ## The matrix @var{map} must be a @math{M} by 3 matrix. The three columns of the
18 ## colormap matrix are plotted in red, green, and blue lines.
20 ## If an output is requested, a graphics handle to the plot is returned.
23 function h_out = rgbplot(map)
25 if (!ismatrix(map) || ndims(map) != 2 || columns(map) != 3)
26 error("rgbplot: input must be a M by 3 matrix");
30 h = plot(map(:,1), "-r", map(:,2), "g-", map(:,3), "b-");