X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=octave_packages%2Fimage-1.0.15%2Frgbplot.m;fp=octave_packages%2Fimage-1.0.15%2Frgbplot.m;h=c0b277a8121581466adb336fab048bc2ed3fe088;hb=f5f7a74bd8a4900f0b797da6783be80e11a68d86;hp=0000000000000000000000000000000000000000;hpb=1705066eceaaea976f010f669ce8e972f3734b05;p=CreaPhase.git diff --git a/octave_packages/image-1.0.15/rgbplot.m b/octave_packages/image-1.0.15/rgbplot.m new file mode 100644 index 0000000..c0b277a --- /dev/null +++ b/octave_packages/image-1.0.15/rgbplot.m @@ -0,0 +1,34 @@ +## Copyright (C) 2005 Berge-Gladel +## +## This program is free software; you can redistribute it and/or +## modify it under the terms of the GNU General Public License +## as published by the Free Software Foundation; either version 2 +## of the License, or (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. + +## -*- texinfo -*- +## @deftypefn {Function File} rgbplot (@var{map}) +## @deftypefnx{Function File} @var{h} = rgbplot (@var{map}) +## Plot a given color map. +## The matrix @var{map} must be a @math{M} by 3 matrix. The three columns of the +## colormap matrix are plotted in red, green, and blue lines. +## +## If an output is requested, a graphics handle to the plot is returned. +## @end deftypefn + +function h_out = rgbplot(map) + ## Check input + if (!ismatrix(map) || ndims(map) != 2 || columns(map) != 3) + error("rgbplot: input must be a M by 3 matrix"); + endif + + ## Plot + h = plot(map(:,1), "-r", map(:,2), "g-", map(:,3), "b-"); + if (nargout > 0) + h_out = h; + endif +endfunction