Mercurial > hg > octave-lyh
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 |
rev | line source |
---|---|
7017 | 1 ## Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2003, 2004, |
8920 | 2 ## 2005, 2006, 2007, 2008, 2009 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 |
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 | 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 | 24 |
2314 | 25 ## Author: jwe |
26 | |
6459 | 27 function retval = __plt2vm__ (h, x, y, options, properties) |
6146 | 28 |
6459 | 29 if (nargin < 3 || nargin > 5) |
6146 | 30 print_usage (); |
31 endif | |
4 | 32 |
6264 | 33 if (nargin < 4 || isempty (options)) |
34 options = __default_plot_options__ (); | |
4 | 35 endif |
36 | |
6459 | 37 if (nargin < 5) |
38 properties = {}; | |
39 endif | |
40 | |
4 | 41 [x_nr, x_nc] = size (x); |
42 [y_nr, y_nc] = size (y); | |
43 | |
44 if (x_nr == 1) | |
45 x = x'; | |
46 tmp = x_nr; | |
47 x_nr = x_nc; | |
48 x_nc = tmp; | |
49 endif | |
50 | |
51 if (x_nr == y_nr) | |
52 1; | |
53 elseif (x_nr == y_nc) | |
54 y = y'; | |
55 tmp = y_nr; | |
56 y_nr = y_nc; | |
57 y_nc = tmp; | |
58 else | |
2315 | 59 error ("__plt2vm__: matrix dimensions must match"); |
4 | 60 endif |
61 | |
62 if (y_nc > 0) | |
6264 | 63 if (numel (options) == 1) |
64 options = repmat (options(:), y_nc, 1); | |
6146 | 65 endif |
6302 | 66 retval = zeros (y_nc, 1); |
5115 | 67 for i = 1:y_nc |
6265 | 68 tkey = options(i).key; |
6257 | 69 if (! isempty (tkey)) |
70 set (h, "key", "on"); | |
71 endif | |
6264 | 72 color = options(i).color; |
73 if (isempty (color)) | |
74 color = __next_line_color__ (); | |
75 endif | |
8070
3b53b25e2550
Add data sources and line series
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
76 |
8257 | 77 retval(i) = line (x, y(:,i), "keylabel", tkey, "color", color, |
78 "linestyle", options(i).linestyle, | |
79 "marker", options(i).marker, properties{:}); | |
4 | 80 endfor |
81 else | |
2315 | 82 error ("__plt2vm__: arguments must be a matrices"); |
4 | 83 endif |
84 | |
85 endfunction |