7017
|
1 ## Copyright (C) 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2004, 2005, |
|
2 ## 2006, 2007 John W. Eaton |
2313
|
3 ## |
|
4 ## This file is part of Octave. |
|
5 ## |
|
6 ## Octave is free software; you can redistribute it and/or modify it |
|
7 ## under the terms of the GNU General Public License as published by |
7016
|
8 ## the Free Software Foundation; either version 3 of the License, or (at |
|
9 ## your option) any later version. |
2313
|
10 ## |
|
11 ## Octave is distributed in the hope that it will be useful, but |
|
12 ## WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
14 ## General Public License for more details. |
|
15 ## |
|
16 ## You should have received a copy of the GNU General Public License |
7016
|
17 ## along with Octave; see the file COPYING. If not, see |
|
18 ## <http://www.gnu.org/licenses/>. |
245
|
19 |
3368
|
20 ## -*- texinfo -*- |
|
21 ## @deftypefn {Function File} {} polar (@var{theta}, @var{rho}, @var{fmt}) |
7180
|
22 ## Make a two-dimensional plot given the polar coordinates @var{theta} and |
3368
|
23 ## @var{rho}. |
2311
|
24 ## |
|
25 ## The optional third argument specifies the line type. |
6895
|
26 ## @seealso{plot} |
3368
|
27 ## @end deftypefn |
4
|
28 |
2314
|
29 ## Author: jwe |
|
30 |
6302
|
31 function retval = polar (varargin) |
4
|
32 |
7215
|
33 [h, varargin] = __plt_get_axis_arg__ ("polar", varargin{:}); |
7216
|
34 |
7207
|
35 oldh = gca (); |
|
36 unwind_protect |
|
37 axes (h); |
|
38 newplot (); |
3063
|
39 |
7207
|
40 nargs = numel (varargin); |
4
|
41 |
7207
|
42 if (nargs == 3) |
|
43 if (! ischar (varargin{3})) |
|
44 error ("polar: third argument must be a string"); |
|
45 endif |
|
46 tmp = __plr2__ (h, varargin{:}); |
|
47 elseif (nargin == 2) |
|
48 if (ischar (varargin{2})) |
|
49 tmp = __plr1__ (h, varargin{:}); |
|
50 else |
|
51 fmt = ""; |
|
52 tmp = __plr2__ (h, varargin{:}, fmt); |
|
53 endif |
|
54 elseif (nargin == 1) |
|
55 fmt = ""; |
|
56 tmp = __plr1__ (h, varargin{:}, fmt); |
|
57 else |
|
58 print_usage (); |
934
|
59 endif |
7207
|
60 |
|
61 if (nargout > 0) |
|
62 retval = tmp; |
934
|
63 endif |
7207
|
64 unwind_protect_cleanup |
|
65 axes (oldh); |
|
66 end_unwind_protect |
6302
|
67 |
4
|
68 endfunction |