Mercurial > hg > octave-lyh
annotate scripts/plot/polar.m @ 11191:01ddaedd6ad5
Reverse changeset b1f4bdc276b6. Use all lower case for "uniformoutput" option.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Thu, 04 Nov 2010 12:18:08 -0700 |
parents | 390d93e20531 |
children | fd0a3ac60b0e |
rev | line source |
---|---|
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 -*- |
10730
390d93e20531
Plot commands now print usage information without errors
Rik <octave@nomad.inbox5.com>
parents:
10549
diff
changeset
|
21 ## @deftypefn {Function File} {} polar (@var{theta}, @var{rho}) |
390d93e20531
Plot commands now print usage information without errors
Rik <octave@nomad.inbox5.com>
parents:
10549
diff
changeset
|
22 ## @deftypefnx {Function File} {} polar (@var{theta}, @var{rho}, @var{fmt}) |
390d93e20531
Plot commands now print usage information without errors
Rik <octave@nomad.inbox5.com>
parents:
10549
diff
changeset
|
23 ## @deftypefnx {Function File} {} polar (@var{h}, @dots{}) |
390d93e20531
Plot commands now print usage information without errors
Rik <octave@nomad.inbox5.com>
parents:
10549
diff
changeset
|
24 ## @deftypefnx {Function File} {@var{h} =} polar (@dots{}) |
7180 | 25 ## Make a two-dimensional plot given the polar coordinates @var{theta} and |
3368 | 26 ## @var{rho}. |
2311 | 27 ## |
28 ## The optional third argument specifies the line type. | |
6895 | 29 ## @seealso{plot} |
3368 | 30 ## @end deftypefn |
4 | 31 |
2314 | 32 ## Author: jwe |
33 | |
6302 | 34 function retval = polar (varargin) |
4 | 35 |
7321 | 36 [h, varargin, nargs] = __plt_get_axis_arg__ ("polar", varargin{:}); |
7216 | 37 |
10730
390d93e20531
Plot commands now print usage information without errors
Rik <octave@nomad.inbox5.com>
parents:
10549
diff
changeset
|
38 if (nargs < 1) |
390d93e20531
Plot commands now print usage information without errors
Rik <octave@nomad.inbox5.com>
parents:
10549
diff
changeset
|
39 print_usage(); |
390d93e20531
Plot commands now print usage information without errors
Rik <octave@nomad.inbox5.com>
parents:
10549
diff
changeset
|
40 endif |
390d93e20531
Plot commands now print usage information without errors
Rik <octave@nomad.inbox5.com>
parents:
10549
diff
changeset
|
41 |
7207 | 42 oldh = gca (); |
43 unwind_protect | |
44 axes (h); | |
45 newplot (); | |
3063 | 46 |
7207 | 47 if (nargs == 3) |
48 if (! ischar (varargin{3})) | |
10549 | 49 error ("polar: third argument must be a string"); |
7207 | 50 endif |
51 tmp = __plr2__ (h, varargin{:}); | |
7321 | 52 maxr = max (varargin {2} (:)); |
53 elseif (nargs == 2) | |
7207 | 54 if (ischar (varargin{2})) |
10549 | 55 tmp = __plr1__ (h, varargin{:}); |
56 if (iscomplex(varargin{1})) | |
57 maxr = max (imag(varargin{1})(:)); | |
58 else | |
59 maxr = max (varargin{1}(:)); | |
60 endif | |
7207 | 61 else |
10549 | 62 fmt = ""; |
63 tmp = __plr2__ (h, varargin{:}, fmt); | |
64 maxr = max (varargin {2} (:)); | |
7207 | 65 endif |
7321 | 66 elseif (nargs == 1) |
7207 | 67 fmt = ""; |
68 tmp = __plr1__ (h, varargin{:}, fmt); | |
7321 | 69 if (iscomplex(varargin{1})) |
10549 | 70 maxr = max (imag(varargin{1})(:)); |
7321 | 71 else |
10549 | 72 maxr = max (varargin{1}(:)); |
7321 | 73 endif |
7207 | 74 else |
75 print_usage (); | |
934 | 76 endif |
7207 | 77 |
7321 | 78 set (h, "xlim", [-maxr, maxr], "ylim", [-maxr, maxr], |
10549 | 79 "xaxislocation", "zero", "yaxislocation", "zero", |
80 "plotboxaspectratio", [1, 1, 1]); | |
7321 | 81 |
7207 | 82 if (nargout > 0) |
83 retval = tmp; | |
934 | 84 endif |
7207 | 85 unwind_protect_cleanup |
86 axes (oldh); | |
87 end_unwind_protect | |
6302 | 88 |
4 | 89 endfunction |
9896
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
90 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
91 function retval = __plr1__ (h, theta, fmt) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
92 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
93 if (nargin != 3) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
94 print_usage (); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
95 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
96 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
97 [nr, nc] = size (theta); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
98 if (nr == 1) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
99 theta = theta'; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
100 tmp = nr; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
101 nr = nc; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
102 nc = tmp; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
103 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
104 theta_i = imag (theta); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
105 if (any (theta_i)) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
106 rho = theta_i; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
107 theta = real (theta); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
108 else |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
109 rho = theta; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
110 theta = (1:nr)'; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
111 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
112 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
113 retval = __plr2__ (h, theta, rho, fmt); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
114 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
115 endfunction |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
116 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
117 function retval = __plr2__ (h, theta, rho, fmt) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
118 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
119 if (nargin != 4) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
120 print_usage (); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
121 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
122 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
123 if (any (imag (theta))) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
124 theta = real (theta); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
125 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
126 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
127 if (any (imag (rho))) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
128 rho = real (rho); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
129 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
130 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
131 if (isscalar (theta)) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
132 if (isscalar (rho)) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
133 x = rho * cos (theta); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
134 y = rho * sin (theta); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
135 retval = __plt__ ("polar", h, x, y, fmt); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
136 else |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
137 error ("__plr2__: invalid data for plotting"); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
138 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
139 elseif (isvector (theta)) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
140 if (isvector (rho)) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
141 if (length (theta) != length (rho)) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
142 error ("__plr2__: vector lengths must match"); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
143 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
144 if (rows (rho) == 1) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
145 rho = rho'; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
146 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
147 if (rows (theta) == 1) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
148 theta = theta'; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
149 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
150 x = rho .* cos (theta); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
151 y = rho .* sin (theta); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
152 retval = __plt__ ("polar", h, x, y, fmt); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
153 elseif (ismatrix (rho)) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
154 [t_nr, t_nc] = size (theta); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
155 if (t_nr == 1) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
156 theta = theta'; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
157 tmp = t_nr; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
158 t_nr = t_nc; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
159 t_nc = tmp; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
160 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
161 [r_nr, r_nc] = size (rho); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
162 if (t_nr != r_nr) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
163 rho = rho'; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
164 tmp = r_nr; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
165 r_nr = r_nc; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
166 r_nc = tmp; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
167 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
168 if (t_nr != r_nr) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
169 error ("__plr2__: vector and matrix sizes must match"); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
170 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
171 x = diag (cos (theta)) * rho; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
172 y = diag (sin (theta)) * rho; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
173 retval = __plt__ ("polar", h, x, y, fmt); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
174 else |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
175 error ("__plr2__: invalid data for plotting"); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
176 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
177 elseif (ismatrix (theta)) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
178 if (isvector (rho)) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
179 [r_nr, r_nc] = size (rho); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
180 if (r_nr == 1) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
181 rho = rho'; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
182 tmp = r_nr; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
183 r_nr = r_nc; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
184 r_nc = tmp; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
185 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
186 [t_nr, t_nc] = size (theta); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
187 if (r_nr != t_nr) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
188 theta = theta'; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
189 tmp = t_nr; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
190 t_nr = t_nc; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
191 t_nc = tmp; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
192 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
193 if (r_nr != t_nr) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
194 error ("__plr2__: vector and matrix sizes must match"); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
195 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
196 diag_r = diag (rho); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
197 x = diag_r * cos (theta); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
198 y = diag_r * sin (theta); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
199 retval = __plt__ ("polar", h, x, y, fmt); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
200 elseif (ismatrix (rho)) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
201 if (! size_equal (rho, theta)) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
202 error ("__plr2__: matrix dimensions must match"); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
203 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
204 x = rho .* cos (theta); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
205 y = rho .* sin (theta); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
206 retval = __plt__ ("polar", h, x, y, fmt); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
207 else |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
208 error ("__plr2__: invalid data for plotting"); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
209 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
210 else |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
211 error ("__plr2__: invalid data for plotting"); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
212 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
213 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
7321
diff
changeset
|
214 endfunction |