annotate scripts/plot/__plt2vm__.m @ 9042:97aa01a85ea4

Merge documentation cleanup changes to main branch.
author Rik <rdrider0-list@yahoo.com>
date Wed, 25 Mar 2009 18:13:08 -0700
parents eb63fbe60fab
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7017
a1dbe9d80eee [project @ 2007-10-12 21:27:11 by jwe]
jwe
parents: 7016
diff changeset
1 ## Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2003, 2004,
8920
eb63fbe60fab update copyright notices
John W. Eaton <jwe@octave.org>
parents: 8812
diff changeset
2 ## 2005, 2006, 2007, 2008, 2009 John W. Eaton
2313
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2303
diff changeset
3 ##
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2303
diff changeset
4 ## This file is part of Octave.
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2303
diff changeset
5 ##
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2303
diff changeset
6 ## Octave is free software; you can redistribute it and/or modify it
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2303
diff changeset
7 ## under the terms of the GNU General Public License as published by
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6895
diff changeset
8 ## the Free Software Foundation; either version 3 of the License, or (at
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6895
diff changeset
9 ## your option) any later version.
2313
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2303
diff changeset
10 ##
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2303
diff changeset
11 ## Octave is distributed in the hope that it will be useful, but
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2303
diff changeset
12 ## WITHOUT ANY WARRANTY; without even the implied warranty of
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2303
diff changeset
13 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2303
diff changeset
14 ## General Public License for more details.
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2303
diff changeset
15 ##
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2303
diff changeset
16 ## You should have received a copy of the GNU General Public License
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6895
diff changeset
17 ## along with Octave; see the file COPYING. If not, see
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6895
diff changeset
18 ## <http://www.gnu.org/licenses/>.
245
16a24e76d6e0 [project @ 1993-12-03 02:00:15 by jwe]
jwe
parents: 4
diff changeset
19
8812
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8257
diff changeset
20 ## -*- texinfo -*-
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8257
diff changeset
21 ## @deftypefn {Function File} {} __plt2vm__ (@var{h}, @var{x}, @var{y}, @var{options}, @var{properties})
6895
76e3d985ae56 [project @ 2007-09-13 18:22:38 by jwe]
jwe
parents: 6459
diff changeset
22 ## Undocumented internal function.
8812
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8257
diff changeset
23 ## @end deftypefn
3402
9610d364e444 [project @ 2000-01-05 04:36:38 by jwe]
jwe
parents: 3162
diff changeset
24
2314
949ab8eba8bc [project @ 1996-07-12 03:58:02 by jwe]
jwe
parents: 2313
diff changeset
25 ## Author: jwe
949ab8eba8bc [project @ 1996-07-12 03:58:02 by jwe]
jwe
parents: 2313
diff changeset
26
6459
5dc550e1f419 [project @ 2007-03-26 18:11:58 by jwe]
jwe
parents: 6302
diff changeset
27 function retval = __plt2vm__ (h, x, y, options, properties)
6146
1a6d826e92b5 [project @ 2006-11-09 03:13:11 by jwe]
jwe
parents: 6046
diff changeset
28
6459
5dc550e1f419 [project @ 2007-03-26 18:11:58 by jwe]
jwe
parents: 6302
diff changeset
29 if (nargin < 3 || nargin > 5)
6146
1a6d826e92b5 [project @ 2006-11-09 03:13:11 by jwe]
jwe
parents: 6046
diff changeset
30 print_usage ();
1a6d826e92b5 [project @ 2006-11-09 03:13:11 by jwe]
jwe
parents: 6046
diff changeset
31 endif
4
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
32
6264
cc2bee854d23 [project @ 2007-02-01 10:00:05 by jwe]
jwe
parents: 6257
diff changeset
33 if (nargin < 4 || isempty (options))
cc2bee854d23 [project @ 2007-02-01 10:00:05 by jwe]
jwe
parents: 6257
diff changeset
34 options = __default_plot_options__ ();
4
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
35 endif
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
36
6459
5dc550e1f419 [project @ 2007-03-26 18:11:58 by jwe]
jwe
parents: 6302
diff changeset
37 if (nargin < 5)
5dc550e1f419 [project @ 2007-03-26 18:11:58 by jwe]
jwe
parents: 6302
diff changeset
38 properties = {};
5dc550e1f419 [project @ 2007-03-26 18:11:58 by jwe]
jwe
parents: 6302
diff changeset
39 endif
5dc550e1f419 [project @ 2007-03-26 18:11:58 by jwe]
jwe
parents: 6302
diff changeset
40
4
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
41 [x_nr, x_nc] = size (x);
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
42 [y_nr, y_nc] = size (y);
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
43
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
44 if (x_nr == 1)
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
45 x = x';
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
46 tmp = x_nr;
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
47 x_nr = x_nc;
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
48 x_nc = tmp;
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
49 endif
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
50
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
51 if (x_nr == y_nr)
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
52 1;
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
53 elseif (x_nr == y_nc)
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
54 y = y';
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
55 tmp = y_nr;
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
56 y_nr = y_nc;
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
57 y_nc = tmp;
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
58 else
2315
bf8b1bffb58f [project @ 1996-07-12 17:22:07 by jwe]
jwe
parents: 2314
diff changeset
59 error ("__plt2vm__: matrix dimensions must match");
4
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
60 endif
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
61
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
62 if (y_nc > 0)
6264
cc2bee854d23 [project @ 2007-02-01 10:00:05 by jwe]
jwe
parents: 6257
diff changeset
63 if (numel (options) == 1)
cc2bee854d23 [project @ 2007-02-01 10:00:05 by jwe]
jwe
parents: 6257
diff changeset
64 options = repmat (options(:), y_nc, 1);
6146
1a6d826e92b5 [project @ 2006-11-09 03:13:11 by jwe]
jwe
parents: 6046
diff changeset
65 endif
6302
a5cd8b77e892 [project @ 2007-02-13 08:08:33 by jwe]
jwe
parents: 6265
diff changeset
66 retval = zeros (y_nc, 1);
5115
57372235194b [project @ 2005-01-24 18:38:45 by jwe]
jwe
parents: 5072
diff changeset
67 for i = 1:y_nc
6265
598c2be12ab9 [project @ 2007-02-01 10:09:53 by jwe]
jwe
parents: 6264
diff changeset
68 tkey = options(i).key;
6257
44c91c5dfe1d [project @ 2007-01-30 19:16:52 by jwe]
jwe
parents: 6146
diff changeset
69 if (! isempty (tkey))
44c91c5dfe1d [project @ 2007-01-30 19:16:52 by jwe]
jwe
parents: 6146
diff changeset
70 set (h, "key", "on");
44c91c5dfe1d [project @ 2007-01-30 19:16:52 by jwe]
jwe
parents: 6146
diff changeset
71 endif
6264
cc2bee854d23 [project @ 2007-02-01 10:00:05 by jwe]
jwe
parents: 6257
diff changeset
72 color = options(i).color;
cc2bee854d23 [project @ 2007-02-01 10:00:05 by jwe]
jwe
parents: 6257
diff changeset
73 if (isempty (color))
cc2bee854d23 [project @ 2007-02-01 10:00:05 by jwe]
jwe
parents: 6257
diff changeset
74 color = __next_line_color__ ();
cc2bee854d23 [project @ 2007-02-01 10:00:05 by jwe]
jwe
parents: 6257
diff changeset
75 endif
8070
3b53b25e2550 Add data sources and line series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
76
8257
79c874fe5100 More plot object updates
David Bateman <dbateman@free.fr>
parents: 8076
diff changeset
77 retval(i) = line (x, y(:,i), "keylabel", tkey, "color", color,
79c874fe5100 More plot object updates
David Bateman <dbateman@free.fr>
parents: 8076
diff changeset
78 "linestyle", options(i).linestyle,
79c874fe5100 More plot object updates
David Bateman <dbateman@free.fr>
parents: 8076
diff changeset
79 "marker", options(i).marker, properties{:});
4
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
80 endfor
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
81 else
2315
bf8b1bffb58f [project @ 1996-07-12 17:22:07 by jwe]
jwe
parents: 2314
diff changeset
82 error ("__plt2vm__: arguments must be a matrices");
4
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
83 endif
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
84
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
85 endfunction