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/>. |
933
|
18 |
6895
|
19 ## Undocumented internal function. |
3402
|
20 |
2314
|
21 ## Author: jwe |
|
22 |
6459
|
23 function retval = __plt2__ (h, x1, x2, options, properties) |
933
|
24 |
6459
|
25 if (nargin < 3 || nargin > 5) |
6046
|
26 print_usage (); |
933
|
27 endif |
|
28 |
6264
|
29 if (nargin < 4 || isempty (options)) |
|
30 options = __default_plot_options__ (); |
933
|
31 endif |
|
32 |
6459
|
33 if (nargin < 5) |
|
34 properties = {}; |
|
35 endif |
|
36 |
6264
|
37 if (! isstruct (options)) |
|
38 error ("__plt1__: options must be a struct array"); |
933
|
39 endif |
|
40 |
|
41 if (any (any (imag (x1)))) |
|
42 x1 = real (x1); |
|
43 endif |
5115
|
44 |
933
|
45 if (any (any (imag (x2)))) |
|
46 x2 = real (x2); |
|
47 endif |
5115
|
48 |
6302
|
49 h_set = false; |
4030
|
50 if (isscalar (x1)) |
|
51 if (isscalar (x2)) |
6459
|
52 retval = __plt2ss__ (h, x1, x2, options, properties); |
5115
|
53 else |
|
54 error ("__plt2__: invalid data for plotting"); |
933
|
55 endif |
4030
|
56 elseif (isvector (x1)) |
|
57 if (isvector (x2)) |
6459
|
58 retval = __plt2vv__ (h, x1, x2, options, properties); |
4030
|
59 elseif (ismatrix (x2)) |
6459
|
60 retval = __plt2vm__ (h, x1, x2, options, properties); |
5115
|
61 else |
|
62 error ("__plt2__: invalid data for plotting"); |
933
|
63 endif |
4030
|
64 elseif (ismatrix (x1)) |
|
65 if (isvector (x2)) |
6459
|
66 retval = __plt2mv__ (h, x1, x2, options, properties); |
4030
|
67 elseif (ismatrix (x2)) |
6459
|
68 retval = __plt2mm__ (h, x1, x2, options, properties); |
5115
|
69 else |
|
70 error ("__plt2__: invalid data for plotting"); |
933
|
71 endif |
5741
|
72 elseif (isempty (x1) && isempty (x2)) |
6795
|
73 retval = zeros (0, 1); |
5115
|
74 else |
|
75 error ("__plt2__: invalid data for plotting"); |
933
|
76 endif |
|
77 |
|
78 endfunction |