2847
|
1 ## Copyright (C) 1996, 1997 John W. Eaton |
2313
|
2 ## |
|
3 ## This file is part of Octave. |
|
4 ## |
|
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 |
7016
|
7 ## the Free Software Foundation; either version 3 of the License, or (at |
|
8 ## your option) any later version. |
2313
|
9 ## |
|
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. |
|
14 ## |
|
15 ## You should have received a copy of the GNU General Public License |
7016
|
16 ## along with Octave; see the file COPYING. If not, see |
|
17 ## <http://www.gnu.org/licenses/>. |
245
|
18 |
3368
|
19 ## -*- texinfo -*- |
|
20 ## @deftypefn {Function File} {} polar (@var{theta}, @var{rho}, @var{fmt}) |
|
21 ## Make a two-dimensional plot given polar the coordinates @var{theta} and |
|
22 ## @var{rho}. |
2311
|
23 ## |
|
24 ## The optional third argument specifies the line type. |
6895
|
25 ## @seealso{plot} |
3368
|
26 ## @end deftypefn |
4
|
27 |
2314
|
28 ## Author: jwe |
|
29 |
6302
|
30 function retval = polar (varargin) |
4
|
31 |
6257
|
32 newplot (); |
3063
|
33 |
6257
|
34 ## [h, varargin] = __plt_get_axis_arg__ ("semilogx", varargin{:}); |
|
35 h = gca (); |
4
|
36 |
6257
|
37 nargs = numel (varargin); |
|
38 |
|
39 if (nargs == 3) |
|
40 if (! ischar (varargin{3})) |
934
|
41 error ("polar: third argument must be a string"); |
|
42 endif |
6302
|
43 tmp = __plr2__ (h, varargin{:}); |
4
|
44 elseif (nargin == 2) |
6257
|
45 if (ischar (varargin{2})) |
6302
|
46 tmp = __plr1__ (h, varargin{:}); |
934
|
47 else |
|
48 fmt = ""; |
6302
|
49 tmp = __plr2__ (h, varargin{:}, fmt); |
934
|
50 endif |
|
51 elseif (nargin == 1) |
|
52 fmt = ""; |
6302
|
53 tmp = __plr1__ (h, varargin{:}, fmt); |
4
|
54 else |
6046
|
55 print_usage (); |
4
|
56 endif |
|
57 |
6302
|
58 if (nargout > 0) |
|
59 retval = tmp; |
|
60 endif |
|
61 |
4
|
62 endfunction |