comparison scripts/plot/__plt2ss__.m @ 6264:cc2bee854d23

[project @ 2007-02-01 10:00:05 by jwe]
author jwe
date Thu, 01 Feb 2007 10:00:05 +0000
parents 44c91c5dfe1d
children a5cd8b77e892
comparison
equal deleted inserted replaced
6263:d60127449a29 6264:cc2bee854d23
16 ## along with Octave; see the file COPYING. If not, write to the Free 16 ## along with Octave; see the file COPYING. If not, write to the Free
17 ## Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 17 ## Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 ## 02110-1301, USA. 18 ## 02110-1301, USA.
19 19
20 ## -*- texinfo -*- 20 ## -*- texinfo -*-
21 ## @deftypefn {Function File} {} __plt2ss__ (@var{h}, @var{x}, @var{y}, @var{fmt}, @var{key}) 21 ## @deftypefn {Function File} {} __plt2ss__ (@var{h}, @var{x}, @var{y}, @var{options})
22 ## @end deftypefn 22 ## @end deftypefn
23 23
24 ## Author: jwe 24 ## Author: jwe
25 25
26 function __plt2ss__ (h, x, y, fmt, key) 26 function __plt2ss__ (h, x, y, options)
27 27
28 if (nargin < 3 || nargin > 5) 28 if (nargin < 3 || nargin > 4)
29 print_usage (); 29 print_usage ();
30 endif 30 endif
31 31
32 if (nargin < 4 || isempty (fmt)) 32 if (nargin < 4 || isempty (options))
33 fmt = {""}; 33 options = __default_plot_options__ ();
34 endif 34 endif
35 35
36 if (nargin < 5 || isempty (key)) 36 if (numel (options) > 1)
37 key = {""}; 37 options = options(1);
38 endif
39
40 if (rows (fmt) > 1)
41 fmt = fmt(1);
42 endif
43
44 if (rows (key) > 1)
45 key = key(1);
46 endif 38 endif
47 39
48 [x_nr, x_nc] = size (x); 40 [x_nr, x_nc] = size (x);
49 [y_nr, y_nc] = size (y); 41 [y_nr, y_nc] = size (y);
50 42
51 if (x_nr == 1 && x_nr == y_nr && x_nc == 1 && x_nc == y_nc) 43 if (x_nr == 1 && x_nr == y_nr && x_nc == 1 && x_nc == y_nc)
52 key = key{1}; 44 key = options.key;
53 if (! isempty (key)) 45 if (! isempty (key))
54 set (h, "key", "on"); 46 set (h, "key", "on");
55 endif 47 endif
56 ## FIXME -- need to handle labels and line format. 48 color = options.color;
57 line (x, y, "keylabel", key); 49 if (isempty (color))
50 color = __next_line_color__ ();
51 endif
52 line (x, y, "keylabel", key, "color", color,
53 "linestyle", options.linestyle,
54 "marker", options.marker);
55 );
58 else 56 else
59 error ("__plt2ss__: arguments must be scalars"); 57 error ("__plt2ss__: arguments must be scalars");
60 endif 58 endif
61 59
62 endfunction 60 endfunction