1## Copyright (C) 2006, 2007, 2008, 2009 Kai Habel
3## This file is part of Octave.
5## Octave is free software; you can redistribute it and/or modify it
6## under the terms of the GNU General Public License as published by
7## the Free Software Foundation; either version 3 of the License, or (at
8## your option) any later version.
10## Octave is distributed in the hope that it will be useful, but
11## WITHOUT ANY WARRANTY; without even the implied warranty of
12## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13## General Public License for more details.
15## You should have received a copy of the GNU General Public License
16## along with Octave; see the file COPYING. If not, see
17## <http://www.gnu.org/licenses/>.
20## @deftypefn {Function File} {} shading (@var{type})
21## @deftypefnx {Function File} {} shading (@var{ax}, @dots{})
22## Set the shading of surface or patch graphic objects. Valid arguments
27## Single colored patches with invisible edges.
30## Single colored patches with visible edges.
33## Color between patch vertices are interpolated and the patch edges are
37## If @var{ax} is given the shading is applied to axis @var{ax} instead
38## of the current axis.
41## Author: Kai Habel <kai.habel@gmx.de>
43function shading (varargin)
45 [ax, varargin] = __plt_get_axis_arg__ ("shading", varargin{:});
47 if (nargin != 1 && nargin != 2)
53 h1 = findobj (ax, "type", "patch");
54 h2 = findobj (ax, "type", "surface");
60 if (strcmpi (mode, "flat"))
61 set (h, "facecolor", "flat");
62 set (h, "edgecolor", "none");
63 elseif (strcmpi (mode, "interp"))
64 set (h, "facecolor", "interp");
65 set (h, "edgecolor", "none");
66 elseif (strcmpi (mode, "faceted"))
67 set (h, "facecolor", "flat");
68 set (h, "edgecolor", [0 0 0]);
70 error ("unknown argument");
81%! title('shading "faceted"')
86%! title('shading "interp"')
91%! title('shading "faceted"')
96%! title('shading "interp"')