annotate scripts/plot/fill.m @ 17075:806f48d8a577

fill.m, shading.m: Overhaul to use new __plt_get_axis_arg__. * scripts/plot/fill.m: Overhaul to use new __plt_get_axis_arg__. Redo docstring. * scripts/plot/shading.m: Update to use new __plt_get_axis_arg__.
author Rik <rik@octave.org>
date Wed, 24 Jul 2013 23:12:46 -0700
parents 11949c9795a0
children eaab03308c0b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
14138
72c96de7a403 maint: update copyright notices for 2012
John W. Eaton <jwe@octave.org>
parents: 14001
diff changeset
1 ## Copyright (C) 2007-2012 David Bateman
7020
e31f12bb9194 [project @ 2007-10-13 05:13:28 by dbateman]
dbateman
parents:
diff changeset
2 ##
e31f12bb9194 [project @ 2007-10-13 05:13:28 by dbateman]
dbateman
parents:
diff changeset
3 ## This file is part of Octave.
e31f12bb9194 [project @ 2007-10-13 05:13:28 by dbateman]
dbateman
parents:
diff changeset
4 ##
e31f12bb9194 [project @ 2007-10-13 05:13:28 by dbateman]
dbateman
parents:
diff changeset
5 ## Octave is free software; you can redistribute it and/or modify it
e31f12bb9194 [project @ 2007-10-13 05:13:28 by dbateman]
dbateman
parents:
diff changeset
6 ## under the terms of the GNU General Public License as published by
e31f12bb9194 [project @ 2007-10-13 05:13:28 by dbateman]
dbateman
parents:
diff changeset
7 ## the Free Software Foundation; either version 3 of the License, or (at
e31f12bb9194 [project @ 2007-10-13 05:13:28 by dbateman]
dbateman
parents:
diff changeset
8 ## your option) any later version.
e31f12bb9194 [project @ 2007-10-13 05:13:28 by dbateman]
dbateman
parents:
diff changeset
9 ##
e31f12bb9194 [project @ 2007-10-13 05:13:28 by dbateman]
dbateman
parents:
diff changeset
10 ## Octave is distributed in the hope that it will be useful, but
e31f12bb9194 [project @ 2007-10-13 05:13:28 by dbateman]
dbateman
parents:
diff changeset
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
e31f12bb9194 [project @ 2007-10-13 05:13:28 by dbateman]
dbateman
parents:
diff changeset
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
e31f12bb9194 [project @ 2007-10-13 05:13:28 by dbateman]
dbateman
parents:
diff changeset
13 ## General Public License for more details.
e31f12bb9194 [project @ 2007-10-13 05:13:28 by dbateman]
dbateman
parents:
diff changeset
14 ##
e31f12bb9194 [project @ 2007-10-13 05:13:28 by dbateman]
dbateman
parents:
diff changeset
15 ## You should have received a copy of the GNU General Public License
e31f12bb9194 [project @ 2007-10-13 05:13:28 by dbateman]
dbateman
parents:
diff changeset
16 ## along with Octave; see the file COPYING. If not, see
e31f12bb9194 [project @ 2007-10-13 05:13:28 by dbateman]
dbateman
parents:
diff changeset
17 ## <http://www.gnu.org/licenses/>.
e31f12bb9194 [project @ 2007-10-13 05:13:28 by dbateman]
dbateman
parents:
diff changeset
18
e31f12bb9194 [project @ 2007-10-13 05:13:28 by dbateman]
dbateman
parents:
diff changeset
19 ## -*- texinfo -*-
10793
be55736a0783 Grammarcheck the documentation from m-files.
Rik <octave@nomad.inbox5.com>
parents: 10549
diff changeset
20 ## @deftypefn {Function File} {} fill (@var{x}, @var{y}, @var{c})
7020
e31f12bb9194 [project @ 2007-10-13 05:13:28 by dbateman]
dbateman
parents:
diff changeset
21 ## @deftypefnx {Function File} {} fill (@var{x1}, @var{y1}, @var{c1}, @var{x2}, @var{y2}, @var{c2})
e31f12bb9194 [project @ 2007-10-13 05:13:28 by dbateman]
dbateman
parents:
diff changeset
22 ## @deftypefnx {Function File} {} fill (@dots{}, @var{prop}, @var{val})
17075
806f48d8a577 fill.m, shading.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 14237
diff changeset
23 ## @deftypefnx {Function File} {} fill (@var{hax}, @dots{})
7650
eb7bdde776f2 Texinfo fixes
John W. Eaton <jwe@octave.org>
parents: 7216
diff changeset
24 ## @deftypefnx {Function File} {@var{h} =} fill (@dots{})
17075
806f48d8a577 fill.m, shading.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 14237
diff changeset
25 ## Create one or more filled 2-D polygons.
806f48d8a577 fill.m, shading.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 14237
diff changeset
26 ##
806f48d8a577 fill.m, shading.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 14237
diff changeset
27 ## The inputs @var{x} and @var{y} are the coordinates of the polygon vertices.
806f48d8a577 fill.m, shading.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 14237
diff changeset
28 ## If the inputs are matrices then the rows represent different vertices and
806f48d8a577 fill.m, shading.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 14237
diff changeset
29 ## each column produces a different polygon.
806f48d8a577 fill.m, shading.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 14237
diff changeset
30 ## @code{fill} will close any open polygons before plotting.
806f48d8a577 fill.m, shading.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 14237
diff changeset
31 ##
806f48d8a577 fill.m, shading.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 14237
diff changeset
32 ## The input @var{c} determines the color of the polygon. The simplest form
806f48d8a577 fill.m, shading.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 14237
diff changeset
33 ## is a single color specification such as a @code{plot} format or an
806f48d8a577 fill.m, shading.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 14237
diff changeset
34 ## RGB-triple. In this case the polygon(s) will have one unique color. If
806f48d8a577 fill.m, shading.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 14237
diff changeset
35 ## @var{c} is a vector or matrix then the color data is first scaled using
806f48d8a577 fill.m, shading.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 14237
diff changeset
36 ## @code{caxis} and then indexed into the current colormap. A row vector will
806f48d8a577 fill.m, shading.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 14237
diff changeset
37 ## color each polygon (a column from matrices @var{x} and @var{y}) with a
806f48d8a577 fill.m, shading.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 14237
diff changeset
38 ## single computed color. A matrix @var{c} of the same size as @var{x} and
806f48d8a577 fill.m, shading.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 14237
diff changeset
39 ## @var{y} will compute the color of each vertex and then interpolate the face
806f48d8a577 fill.m, shading.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 14237
diff changeset
40 ## color between the vertices.
806f48d8a577 fill.m, shading.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 14237
diff changeset
41 ##
806f48d8a577 fill.m, shading.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 14237
diff changeset
42 ## Multiple property/value pairs for the underlying patch object may be
806f48d8a577 fill.m, shading.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 14237
diff changeset
43 ## specified, but they must appear in pairs.
806f48d8a577 fill.m, shading.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 14237
diff changeset
44 ##
806f48d8a577 fill.m, shading.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 14237
diff changeset
45 ## If the first argument @var{hax} is an axis handle, then plot into this axis,
806f48d8a577 fill.m, shading.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 14237
diff changeset
46 ## rather than the current axis handle returned by @code{gca}.
14001
5f0bb45e615c doc: Update documentation for functions returning a graphics handle h (Bug #34761)
Rik <octave@nomad.inbox5.com>
parents: 11523
diff changeset
47 ##
5f0bb45e615c doc: Update documentation for functions returning a graphics handle h (Bug #34761)
Rik <octave@nomad.inbox5.com>
parents: 11523
diff changeset
48 ## The optional return value @var{h} is an array of graphics handles to
5f0bb45e615c doc: Update documentation for functions returning a graphics handle h (Bug #34761)
Rik <octave@nomad.inbox5.com>
parents: 11523
diff changeset
49 ## the created patch objects.
17075
806f48d8a577 fill.m, shading.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 14237
diff changeset
50 ##
806f48d8a577 fill.m, shading.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 14237
diff changeset
51 ## Example: red square
806f48d8a577 fill.m, shading.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 14237
diff changeset
52 ##
806f48d8a577 fill.m, shading.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 14237
diff changeset
53 ## @example
806f48d8a577 fill.m, shading.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 14237
diff changeset
54 ## @group
806f48d8a577 fill.m, shading.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 14237
diff changeset
55 ## vertices = [0 0
806f48d8a577 fill.m, shading.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 14237
diff changeset
56 ## 1 0
806f48d8a577 fill.m, shading.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 14237
diff changeset
57 ## 1 1
806f48d8a577 fill.m, shading.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 14237
diff changeset
58 ## 0 1];
806f48d8a577 fill.m, shading.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 14237
diff changeset
59 ## fill (vertices(:,1), vertices(:,2), "r");
806f48d8a577 fill.m, shading.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 14237
diff changeset
60 ## axis ([-0.5 1.5, -0.5 1.5])
806f48d8a577 fill.m, shading.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 14237
diff changeset
61 ## axis equal
806f48d8a577 fill.m, shading.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 14237
diff changeset
62 ## @end group
806f48d8a577 fill.m, shading.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 14237
diff changeset
63 ## @end example
806f48d8a577 fill.m, shading.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 14237
diff changeset
64 ##
806f48d8a577 fill.m, shading.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 14237
diff changeset
65 ## @seealso{patch, caxis, colormap}
7020
e31f12bb9194 [project @ 2007-10-13 05:13:28 by dbateman]
dbateman
parents:
diff changeset
66 ## @end deftypefn
e31f12bb9194 [project @ 2007-10-13 05:13:28 by dbateman]
dbateman
parents:
diff changeset
67
17075
806f48d8a577 fill.m, shading.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 14237
diff changeset
68 function h = fill (varargin)
7020
e31f12bb9194 [project @ 2007-10-13 05:13:28 by dbateman]
dbateman
parents:
diff changeset
69
17075
806f48d8a577 fill.m, shading.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 14237
diff changeset
70 [hax, varargin] = __plt_get_axis_arg__ ("fill", varargin{:});
7216
5389a52df87b [project @ 2007-11-29 19:07:29 by jwe]
jwe
parents: 7215
diff changeset
71
17075
806f48d8a577 fill.m, shading.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 14237
diff changeset
72 hlist = [];
7215
dd88d61d443f [project @ 2007-11-29 16:44:45 by jwe]
jwe
parents: 7208
diff changeset
73 iargs = __find_patches__ (varargin{:});
7216
5389a52df87b [project @ 2007-11-29 19:07:29 by jwe]
jwe
parents: 7215
diff changeset
74
17075
806f48d8a577 fill.m, shading.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 14237
diff changeset
75 oldfig = ifelse (isempty (hax), [], get (0, "currentfigure"));
7215
dd88d61d443f [project @ 2007-11-29 16:44:45 by jwe]
jwe
parents: 7208
diff changeset
76 unwind_protect
17075
806f48d8a577 fill.m, shading.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 14237
diff changeset
77 hax = newplot (hax);
806f48d8a577 fill.m, shading.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 14237
diff changeset
78 old_nxtplt = get (hax, "nextplot");
806f48d8a577 fill.m, shading.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 14237
diff changeset
79 set (hax, "nextplot", "add");
7020
e31f12bb9194 [project @ 2007-10-13 05:13:28 by dbateman]
dbateman
parents:
diff changeset
80
e31f12bb9194 [project @ 2007-10-13 05:13:28 by dbateman]
dbateman
parents:
diff changeset
81 for i = 1 : length (iargs)
e31f12bb9194 [project @ 2007-10-13 05:13:28 by dbateman]
dbateman
parents:
diff changeset
82 if (i == length (iargs))
14230
fe65588c31b8 fill.m: Return column vector of graphics handles
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
83 args = varargin(iargs(i):end);
7020
e31f12bb9194 [project @ 2007-10-13 05:13:28 by dbateman]
dbateman
parents:
diff changeset
84 else
14230
fe65588c31b8 fill.m: Return column vector of graphics handles
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
85 args = varargin(iargs(i):iargs(i+1)-1);
7020
e31f12bb9194 [project @ 2007-10-13 05:13:28 by dbateman]
dbateman
parents:
diff changeset
86 endif
17075
806f48d8a577 fill.m, shading.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 14237
diff changeset
87 [htmp, fail] = __patch__ (hax, args{:});
7020
e31f12bb9194 [project @ 2007-10-13 05:13:28 by dbateman]
dbateman
parents:
diff changeset
88 if (fail)
14230
fe65588c31b8 fill.m: Return column vector of graphics handles
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
89 print_usage ();
7020
e31f12bb9194 [project @ 2007-10-13 05:13:28 by dbateman]
dbateman
parents:
diff changeset
90 endif
17075
806f48d8a577 fill.m, shading.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 14237
diff changeset
91 hlist(end + 1, 1) = htmp;
7020
e31f12bb9194 [project @ 2007-10-13 05:13:28 by dbateman]
dbateman
parents:
diff changeset
92 endfor
17075
806f48d8a577 fill.m, shading.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 14237
diff changeset
93
806f48d8a577 fill.m, shading.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 14237
diff changeset
94 if (strncmp (old_nxtplt, "replace", 7))
806f48d8a577 fill.m, shading.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 14237
diff changeset
95 set (hax, "nextplot", old_nxtplt);
11306
262c365eb71c fill.m: Allow multiple filled polygons.
Ben Abbott <bpabbott@mac.com>
parents: 11149
diff changeset
96 endif
17075
806f48d8a577 fill.m, shading.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 14237
diff changeset
97
7215
dd88d61d443f [project @ 2007-11-29 16:44:45 by jwe]
jwe
parents: 7208
diff changeset
98 unwind_protect_cleanup
17075
806f48d8a577 fill.m, shading.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 14237
diff changeset
99 if (! isempty (oldfig))
806f48d8a577 fill.m, shading.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 14237
diff changeset
100 set (0, "currentfigure", oldfig);
806f48d8a577 fill.m, shading.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 14237
diff changeset
101 endif
7215
dd88d61d443f [project @ 2007-11-29 16:44:45 by jwe]
jwe
parents: 7208
diff changeset
102 end_unwind_protect
dd88d61d443f [project @ 2007-11-29 16:44:45 by jwe]
jwe
parents: 7208
diff changeset
103
7020
e31f12bb9194 [project @ 2007-10-13 05:13:28 by dbateman]
dbateman
parents:
diff changeset
104 if (nargout > 0)
17075
806f48d8a577 fill.m, shading.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents: 14237
diff changeset
105 h = hlist;
7020
e31f12bb9194 [project @ 2007-10-13 05:13:28 by dbateman]
dbateman
parents:
diff changeset
106 endif
7215
dd88d61d443f [project @ 2007-11-29 16:44:45 by jwe]
jwe
parents: 7208
diff changeset
107
7020
e31f12bb9194 [project @ 2007-10-13 05:13:28 by dbateman]
dbateman
parents:
diff changeset
108 endfunction
e31f12bb9194 [project @ 2007-10-13 05:13:28 by dbateman]
dbateman
parents:
diff changeset
109
e31f12bb9194 [project @ 2007-10-13 05:13:28 by dbateman]
dbateman
parents:
diff changeset
110 function iargs = __find_patches__ (varargin)
e31f12bb9194 [project @ 2007-10-13 05:13:28 by dbateman]
dbateman
parents:
diff changeset
111 iargs = [];
e31f12bb9194 [project @ 2007-10-13 05:13:28 by dbateman]
dbateman
parents:
diff changeset
112 i = 1;
e31f12bb9194 [project @ 2007-10-13 05:13:28 by dbateman]
dbateman
parents:
diff changeset
113 while (i < nargin)
14230
fe65588c31b8 fill.m: Return column vector of graphics handles
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
114 iargs(end + 1) = i;
8190
73d6b71788c0 use case-insensitive comparison for graphics properties; misc style fixes
John W. Eaton <jwe@octave.org>
parents: 7650
diff changeset
115 if (ischar (varargin{i})
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 8920
diff changeset
116 && (strcmpi (varargin{i}, "faces")
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 8920
diff changeset
117 || strcmpi (varargin{i}, "vertices")))
7020
e31f12bb9194 [project @ 2007-10-13 05:13:28 by dbateman]
dbateman
parents:
diff changeset
118 i += 4;
7208
a730e47fda4d [project @ 2007-11-28 02:32:41 by jwe]
jwe
parents: 7041
diff changeset
119 elseif (isnumeric (varargin{i}))
7020
e31f12bb9194 [project @ 2007-10-13 05:13:28 by dbateman]
dbateman
parents:
diff changeset
120 i += 2;
e31f12bb9194 [project @ 2007-10-13 05:13:28 by dbateman]
dbateman
parents:
diff changeset
121 endif
e31f12bb9194 [project @ 2007-10-13 05:13:28 by dbateman]
dbateman
parents:
diff changeset
122
e31f12bb9194 [project @ 2007-10-13 05:13:28 by dbateman]
dbateman
parents:
diff changeset
123 if (i <= nargin)
e31f12bb9194 [project @ 2007-10-13 05:13:28 by dbateman]
dbateman
parents:
diff changeset
124 while (true);
11149
fe3c3dfc07eb style fix: break lines before && and ||, not after
John W. Eaton <jwe@octave.org>
parents: 10793
diff changeset
125 if (ischar (varargin{i})
fe3c3dfc07eb style fix: break lines before && and ||, not after
John W. Eaton <jwe@octave.org>
parents: 10793
diff changeset
126 && (strcmpi (varargin{i}, "faces")
fe3c3dfc07eb style fix: break lines before && and ||, not after
John W. Eaton <jwe@octave.org>
parents: 10793
diff changeset
127 || strcmpi (varargin{i}, "vertices")))
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 8920
diff changeset
128 break;
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 8920
diff changeset
129 elseif (isnumeric (varargin{i}))
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 8920
diff changeset
130 ## Assume its the colorspec
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 8920
diff changeset
131 i++;
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 8920
diff changeset
132 break;
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 8920
diff changeset
133 elseif (ischar (varargin{i}))
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 8920
diff changeset
134 colspec = tolower (varargin{i});
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 8920
diff changeset
135 collen = length (colspec);
14230
fe65588c31b8 fill.m: Return column vector of graphics handles
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
136 if (any (strncmp (colspec,
fe65588c31b8 fill.m: Return column vector of graphics handles
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
137 {"blue", "black", "k", "red", "green", ...
fe65588c31b8 fill.m: Return column vector of graphics handles
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
138 "yellow", "magenta", "cyan", "white"},
fe65588c31b8 fill.m: Return column vector of graphics handles
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
139 collen)))
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 8920
diff changeset
140 i++;
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 8920
diff changeset
141 break;
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 8920
diff changeset
142 endif
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 8920
diff changeset
143 else
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 8920
diff changeset
144 i += 2;
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 8920
diff changeset
145 endif
7020
e31f12bb9194 [project @ 2007-10-13 05:13:28 by dbateman]
dbateman
parents:
diff changeset
146 endwhile
e31f12bb9194 [project @ 2007-10-13 05:13:28 by dbateman]
dbateman
parents:
diff changeset
147 endif
e31f12bb9194 [project @ 2007-10-13 05:13:28 by dbateman]
dbateman
parents:
diff changeset
148 endwhile
14237
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14230
diff changeset
149
7020
e31f12bb9194 [project @ 2007-10-13 05:13:28 by dbateman]
dbateman
parents:
diff changeset
150 endfunction
e31f12bb9194 [project @ 2007-10-13 05:13:28 by dbateman]
dbateman
parents:
diff changeset
151
14001
5f0bb45e615c doc: Update documentation for functions returning a graphics handle h (Bug #34761)
Rik <octave@nomad.inbox5.com>
parents: 11523
diff changeset
152
7020
e31f12bb9194 [project @ 2007-10-13 05:13:28 by dbateman]
dbateman
parents:
diff changeset
153 %!demo
14237
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14230
diff changeset
154 %! clf;
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14230
diff changeset
155 %! t1 = (1/16:1/8:1) * 2*pi;
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14230
diff changeset
156 %! t2 = ((1/16:1/8:1) + 1/32) * 2*pi;
14001
5f0bb45e615c doc: Update documentation for functions returning a graphics handle h (Bug #34761)
Rik <octave@nomad.inbox5.com>
parents: 11523
diff changeset
157 %! x1 = sin (t1) - 0.8;
5f0bb45e615c doc: Update documentation for functions returning a graphics handle h (Bug #34761)
Rik <octave@nomad.inbox5.com>
parents: 11523
diff changeset
158 %! y1 = cos (t1);
5f0bb45e615c doc: Update documentation for functions returning a graphics handle h (Bug #34761)
Rik <octave@nomad.inbox5.com>
parents: 11523
diff changeset
159 %! x2 = sin (t2) + 0.8;
5f0bb45e615c doc: Update documentation for functions returning a graphics handle h (Bug #34761)
Rik <octave@nomad.inbox5.com>
parents: 11523
diff changeset
160 %! y2 = cos (t2);
5f0bb45e615c doc: Update documentation for functions returning a graphics handle h (Bug #34761)
Rik <octave@nomad.inbox5.com>
parents: 11523
diff changeset
161 %! h = fill (x1,y1,'r', x2,y2,'g');
5f0bb45e615c doc: Update documentation for functions returning a graphics handle h (Bug #34761)
Rik <octave@nomad.inbox5.com>
parents: 11523
diff changeset
162