Mercurial > hg > octave-nkf
annotate scripts/plot/__plt2vv__.m @ 8855:a909d8c01adf
remove duplicate conversions in OPERATORS
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Tue, 24 Feb 2009 11:12:38 +0100 |
parents | 7d48766c21a5 |
children | eb63fbe60fab |
rev | line source |
---|---|
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 |
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} {} __plt2vv__ (@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 = __plt2vv__ (h, x, y, options, properties) |
4 | 28 |
6459 | 29 if (nargin < 3 || nargin > 5) |
6046 | 30 print_usage (); |
6146 | 31 endif |
32 | |
6264 | 33 if (nargin < 4 || isempty (options)) |
34 options = __default_plot_options__ (); | |
6146 | 35 endif |
36 | |
6459 | 37 if (nargin < 5) |
38 properties = {}; | |
39 endif | |
40 | |
6264 | 41 if (numel (options) > 1) |
42 options = options(1); | |
4 | 43 endif |
44 | |
45 [x_nr, x_nc] = size (x); | |
46 [y_nr, y_nc] = size (y); | |
47 | |
48 if (x_nr == 1) | |
49 x = x'; | |
50 tmp = x_nr; | |
51 x_nr = x_nc; | |
52 x_nc = tmp; | |
53 endif | |
54 | |
55 if (y_nr == 1) | |
56 y = y'; | |
57 tmp = y_nr; | |
58 y_nr = y_nc; | |
59 y_nc = tmp; | |
60 endif | |
61 | |
6257 | 62 if (x_nr == y_nr) |
6264 | 63 key = options.key; |
6257 | 64 if (! isempty (key)) |
65 set (h, "key", "on"); | |
66 endif | |
6264 | 67 color = options.color; |
68 if (isempty (color)) | |
69 color = __next_line_color__ (); | |
70 endif | |
8070
3b53b25e2550
Add data sources and line series
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
71 |
8257 | 72 retval = line (x, y, "keylabel", key, "color", color, |
8070
3b53b25e2550
Add data sources and line series
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
73 "linestyle", options.linestyle, |
8257 | 74 "marker", options.marker, properties{:}); |
6257 | 75 else |
2315 | 76 error ("__plt2vv__: vector lengths must match"); |
4 | 77 endif |
78 | |
79 endfunction |