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 |
|
7 ## the Free Software Foundation; either version 2, or (at your option) |
|
8 ## any later version. |
|
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 |
|
16 ## along with Octave; see the file COPYING. If not, write to the Free |
5307
|
17 ## Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|
18 ## 02110-1301, USA. |
933
|
19 |
3449
|
20 ## -*- texinfo -*- |
6459
|
21 ## @deftypefn {Function File} {} __plt2__ (@var{h}, @var{x1}, @var{x2}, @var{options}, @var{properties}) |
3449
|
22 ## @end deftypefn |
3402
|
23 |
2314
|
24 ## Author: jwe |
|
25 |
6459
|
26 function retval = __plt2__ (h, x1, x2, options, properties) |
933
|
27 |
6459
|
28 if (nargin < 3 || nargin > 5) |
6046
|
29 print_usage (); |
933
|
30 endif |
|
31 |
6264
|
32 if (nargin < 4 || isempty (options)) |
|
33 options = __default_plot_options__ (); |
933
|
34 endif |
|
35 |
6459
|
36 if (nargin < 5) |
|
37 properties = {}; |
|
38 endif |
|
39 |
6264
|
40 if (! isstruct (options)) |
|
41 error ("__plt1__: options must be a struct array"); |
933
|
42 endif |
|
43 |
|
44 if (any (any (imag (x1)))) |
|
45 x1 = real (x1); |
|
46 endif |
5115
|
47 |
933
|
48 if (any (any (imag (x2)))) |
|
49 x2 = real (x2); |
|
50 endif |
5115
|
51 |
6302
|
52 h_set = false; |
4030
|
53 if (isscalar (x1)) |
|
54 if (isscalar (x2)) |
6459
|
55 retval = __plt2ss__ (h, x1, x2, options, properties); |
5115
|
56 else |
|
57 error ("__plt2__: invalid data for plotting"); |
933
|
58 endif |
4030
|
59 elseif (isvector (x1)) |
|
60 if (isvector (x2)) |
6459
|
61 retval = __plt2vv__ (h, x1, x2, options, properties); |
4030
|
62 elseif (ismatrix (x2)) |
6459
|
63 retval = __plt2vm__ (h, x1, x2, options, properties); |
5115
|
64 else |
|
65 error ("__plt2__: invalid data for plotting"); |
933
|
66 endif |
4030
|
67 elseif (ismatrix (x1)) |
|
68 if (isvector (x2)) |
6459
|
69 retval = __plt2mv__ (h, x1, x2, options, properties); |
4030
|
70 elseif (ismatrix (x2)) |
6459
|
71 retval = __plt2mm__ (h, x1, x2, options, properties); |
5115
|
72 else |
|
73 error ("__plt2__: invalid data for plotting"); |
933
|
74 endif |
5741
|
75 elseif (isempty (x1) && isempty (x2)) |
6795
|
76 retval = zeros (0, 1); |
5115
|
77 else |
|
78 error ("__plt2__: invalid data for plotting"); |
933
|
79 endif |
|
80 |
|
81 endfunction |