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 |
6895
|
19 ## Undocumented internal function. |
3402
|
20 |
2314
|
21 ## Author: jwe |
|
22 |
6459
|
23 function retval = __plt2vm__ (h, x, y, options, properties) |
6146
|
24 |
6459
|
25 if (nargin < 3 || nargin > 5) |
6146
|
26 print_usage (); |
|
27 endif |
4
|
28 |
6264
|
29 if (nargin < 4 || isempty (options)) |
|
30 options = __default_plot_options__ (); |
4
|
31 endif |
|
32 |
6459
|
33 if (nargin < 5) |
|
34 properties = {}; |
|
35 endif |
|
36 |
4
|
37 [x_nr, x_nc] = size (x); |
|
38 [y_nr, y_nc] = size (y); |
|
39 |
|
40 if (x_nr == 1) |
|
41 x = x'; |
|
42 tmp = x_nr; |
|
43 x_nr = x_nc; |
|
44 x_nc = tmp; |
|
45 endif |
|
46 |
|
47 if (x_nr == y_nr) |
|
48 1; |
|
49 elseif (x_nr == y_nc) |
|
50 y = y'; |
|
51 tmp = y_nr; |
|
52 y_nr = y_nc; |
|
53 y_nc = tmp; |
|
54 else |
2315
|
55 error ("__plt2vm__: matrix dimensions must match"); |
4
|
56 endif |
|
57 |
|
58 if (y_nc > 0) |
6264
|
59 if (numel (options) == 1) |
|
60 options = repmat (options(:), y_nc, 1); |
6146
|
61 endif |
6302
|
62 retval = zeros (y_nc, 1); |
5115
|
63 for i = 1:y_nc |
6265
|
64 tkey = options(i).key; |
6257
|
65 if (! isempty (tkey)) |
|
66 set (h, "key", "on"); |
|
67 endif |
6264
|
68 color = options(i).color; |
|
69 if (isempty (color)) |
|
70 color = __next_line_color__ (); |
|
71 endif |
6302
|
72 retval(i) = line (x, y(:,i), "keylabel", tkey, "color", color, |
|
73 "linestyle", options(i).linestyle, |
6459
|
74 "marker", options(i).marker, properties{:}); |
4
|
75 endfor |
|
76 else |
2315
|
77 error ("__plt2vm__: arguments must be a matrices"); |
4
|
78 endif |
|
79 |
|
80 endfunction |