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