7431
|
1 ## Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2003, 2005, |
|
2 ## 2006, 2007 John W. Eaton |
|
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 |
|
8 ## the Free Software Foundation; either version 3 of the License, or (at |
|
9 ## your option) any later version. |
|
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 |
|
17 ## along with Octave; see the file COPYING. If not, see |
|
18 ## <http://www.gnu.org/licenses/>. |
|
19 |
|
20 ## Undocumented internal function. |
|
21 |
|
22 ## Author: jwe |
|
23 |
|
24 function retval = __plt2vs__ (h, x, y, options, properties) |
|
25 |
|
26 if (nargin < 3 || nargin > 5) |
|
27 print_usage (); |
|
28 endif |
|
29 |
|
30 if (nargin < 4 || isempty (options)) |
|
31 options = __default_plot_options__ (); |
|
32 endif |
|
33 |
|
34 if (nargin < 5) |
|
35 properties = {}; |
|
36 endif |
|
37 |
|
38 if (isvector (x) && isscalar (y)) |
|
39 len = numel (x); |
|
40 if (numel (options) == 1) |
|
41 options = repmat (options(:), len, 1); |
|
42 endif |
|
43 retval = zeros (len, 1); |
|
44 for i = 1:len |
|
45 tkey = options(i).key; |
|
46 if (! isempty (tkey)) |
|
47 set (h, "key", "on"); |
|
48 endif |
|
49 color = options(i).color; |
|
50 if (isempty (color)) |
|
51 color = __next_line_color__ (); |
|
52 endif |
|
53 retval(i) = line (x(i), y, "keylabel", tkey, "color", color, |
|
54 "linestyle", options(i).linestyle, |
|
55 "marker", options(i).marker, properties{:}); |
|
56 endfor |
|
57 else |
|
58 error ("__plt2vs__: first arg must be vector, second arg must be scalar"); |
|
59 endif |
|
60 |
|
61 endfunction |