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 |
6257
|
33 newplot (); |
3063
|
34 |
6257
|
35 ## [h, varargin] = __plt_get_axis_arg__ ("semilogx", varargin{:}); |
|
36 h = gca (); |
4
|
37 |
6257
|
38 nargs = numel (varargin); |
|
39 |
|
40 if (nargs == 3) |
|
41 if (! ischar (varargin{3})) |
934
|
42 error ("polar: third argument must be a string"); |
|
43 endif |
6302
|
44 tmp = __plr2__ (h, varargin{:}); |
4
|
45 elseif (nargin == 2) |
6257
|
46 if (ischar (varargin{2})) |
6302
|
47 tmp = __plr1__ (h, varargin{:}); |
934
|
48 else |
|
49 fmt = ""; |
6302
|
50 tmp = __plr2__ (h, varargin{:}, fmt); |
934
|
51 endif |
|
52 elseif (nargin == 1) |
|
53 fmt = ""; |
6302
|
54 tmp = __plr1__ (h, varargin{:}, fmt); |
4
|
55 else |
6046
|
56 print_usage (); |
4
|
57 endif |
|
58 |
6302
|
59 if (nargout > 0) |
|
60 retval = tmp; |
|
61 endif |
|
62 |
4
|
63 endfunction |