Mercurial > hg > octave-lyh
comparison scripts/plot/polar.m @ 934:be867ddbe4aa
[project @ 1994-11-17 04:23:41 by jwe]
author | jwe |
---|---|
date | Thu, 17 Nov 1994 04:23:41 +0000 |
parents | 3470f1e25a79 |
children | 3f257ab07921 |
comparison
equal
deleted
inserted
replaced
933:598a3aa40360 | 934:be867ddbe4aa |
---|---|
14 # | 14 # |
15 # You should have received a copy of the GNU General Public License | 15 # You should have received a copy of the GNU General Public License |
16 # along with Octave; see the file COPYING. If not, write to the Free | 16 # along with Octave; see the file COPYING. If not, write to the Free |
17 # Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | 17 # Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
18 | 18 |
19 function polar (x1, x2) | 19 function polar (x1, x2, fmt) |
20 | 20 |
21 # usage: polar (theta, rho) | 21 # usage: polar (theta, rho, fmt) |
22 # | 22 # |
23 # Make a 2D plot given polar the coordinates theta and rho. | 23 # Make a 2D plot given polar the coordinates theta and rho. |
24 # | |
25 # The optional third argument specifies the line type. | |
24 # | 26 # |
25 # See also: plot, semilogx, semilogy, loglog, mesh, contour, bar, | 27 # See also: plot, semilogx, semilogy, loglog, mesh, contour, bar, |
26 # stairs, gplot, gsplot, replot, xlabel, ylabel, title | 28 # stairs, gplot, gsplot, replot, xlabel, ylabel, title |
27 | 29 |
28 set nologscale; | 30 set nologscale; |
29 set nopolar; | 31 set nopolar; |
30 | 32 |
31 if (nargin == 1) | 33 if (nargin == 3) |
32 polar_int (x1); | 34 if (isstr (fmt)) |
35 fmt = plot_opt ("polar", fmt); | |
36 else | |
37 error ("polar: third argument must be a string"); | |
38 endif | |
39 polar_int_2 (x1, x2, fmt); | |
33 elseif (nargin == 2) | 40 elseif (nargin == 2) |
34 polar_int (x1, x2); | 41 if (isstr (x2)) |
42 fmt = plot_opt ("polar", x2); | |
43 polar_int_1 (x1, fmt); | |
44 else | |
45 fmt = ""; | |
46 polar_int_2 (x1, x2, fmt); | |
47 endif | |
48 elseif (nargin == 1) | |
49 fmt = ""; | |
50 polar_int_1 (x1, fmt); | |
35 else | 51 else |
36 usage ("polar (x [, y])"); | 52 usage ("polar (theta, rho, fmt)"); |
37 endif | 53 endif |
38 | 54 |
39 endfunction | 55 endfunction |