Mercurial > hg > octave-lyh
annotate scripts/plot/private/__add_datasource__.m @ 16814:64e7bb01fce2
doc: Improve documentation for 2-D plot functions
* doc/interpreter/plot.txi: Rewrite documentation around get/set.
* libinterp/interpfcn/graphics.cc(Fget, Fset): Add seealso links. Add
additional calling forms for get().
* scripts/plot/bar.m, scripts/plot/barh.m, scripts/plot/comet.m,
scripts/plot/comet3.m, scripts/plot/contour.m, scripts/plot/contour3.m,
scripts/plot/contourc.m, scripts/plot/contourf.m, scripts/plot/errorbar.m,
scripts/plot/gca.m, scripts/plot/gcf.m, scripts/plot/gco.m,
scripts/plot/ishghandle.m, scripts/plot/loglogerr.m, scripts/plot/pareto.m,
scripts/plot/pcolor.m, scripts/plot/pie.m, scripts/plot/pie3.m,
scripts/plot/plotmatrix.m, scripts/plot/plotyy.m, scripts/plot/polar.m,
scripts/plot/quiver.m, scripts/plot/quiver3.m, scripts/plot/rose.m,
scripts/plot/scatter.m, scripts/plot/semilogxerr.m, scripts/plot/semilogyerr.m,
scripts/plot/sombrero.m, scripts/plot/stairs.m, scripts/plot/stem.m,
scripts/plot/stem3.m: Improve docstrings.
author | Rik <rik@octave.org> |
---|---|
date | Sat, 22 Jun 2013 17:40:52 -0700 |
parents | 5d3a684236b0 |
children | abf384f5d243 |
rev | line source |
---|---|
14138
72c96de7a403
maint: update copyright notices for 2012
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
1 ## Copyright (C) 2008-2012 David Bateman |
9902
2929c453af8f
omissions from 9899:9f25290a35e8
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
2 ## |
2929c453af8f
omissions from 9899:9f25290a35e8
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
3 ## This file is part of Octave. |
2929c453af8f
omissions from 9899:9f25290a35e8
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
4 ## |
2929c453af8f
omissions from 9899:9f25290a35e8
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
5 ## Octave is free software; you can redistribute it and/or modify it |
2929c453af8f
omissions from 9899:9f25290a35e8
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
6 ## under the terms of the GNU General Public License as published by |
2929c453af8f
omissions from 9899:9f25290a35e8
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
7 ## the Free Software Foundation; either version 3 of the License, or (at |
2929c453af8f
omissions from 9899:9f25290a35e8
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
8 ## your option) any later version. |
2929c453af8f
omissions from 9899:9f25290a35e8
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
9 ## |
2929c453af8f
omissions from 9899:9f25290a35e8
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
10 ## Octave is distributed in the hope that it will be useful, but |
2929c453af8f
omissions from 9899:9f25290a35e8
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of |
2929c453af8f
omissions from 9899:9f25290a35e8
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
2929c453af8f
omissions from 9899:9f25290a35e8
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
13 ## General Public License for more details. |
2929c453af8f
omissions from 9899:9f25290a35e8
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
14 ## |
2929c453af8f
omissions from 9899:9f25290a35e8
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
15 ## You should have received a copy of the GNU General Public License |
2929c453af8f
omissions from 9899:9f25290a35e8
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
16 ## along with Octave; see the file COPYING. If not, see |
2929c453af8f
omissions from 9899:9f25290a35e8
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
17 ## <http://www.gnu.org/licenses/>. |
2929c453af8f
omissions from 9899:9f25290a35e8
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
18 |
2929c453af8f
omissions from 9899:9f25290a35e8
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
19 ## -*- texinfo -*- |
2929c453af8f
omissions from 9899:9f25290a35e8
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
20 ## @deftypefn {Function File} {@var{newargs} =} __add_datasource__ (@var{fcn}, @var{h}, @var{data}, @var{varargin}) |
2929c453af8f
omissions from 9899:9f25290a35e8
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
21 ## Undocumented internal function. |
2929c453af8f
omissions from 9899:9f25290a35e8
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
22 ## @end deftypefn |
2929c453af8f
omissions from 9899:9f25290a35e8
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
23 |
2929c453af8f
omissions from 9899:9f25290a35e8
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
24 function newargs = __add_datasource__ (fcn, h, data, varargin) |
2929c453af8f
omissions from 9899:9f25290a35e8
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
25 |
2929c453af8f
omissions from 9899:9f25290a35e8
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
26 if (nargin < 3) |
10635
d1978e7364ad
Print name of function in error() string messages.
Rik <octave@nomad.inbox5.com>
parents:
10549
diff
changeset
|
27 error ("__add_datasource__: a minimum of 3 inputs are required"); |
9902
2929c453af8f
omissions from 9899:9f25290a35e8
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
28 endif |
2929c453af8f
omissions from 9899:9f25290a35e8
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
29 |
2929c453af8f
omissions from 9899:9f25290a35e8
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
30 if (ischar (data)) |
2929c453af8f
omissions from 9899:9f25290a35e8
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
31 data = {data}; |
2929c453af8f
omissions from 9899:9f25290a35e8
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
32 endif |
2929c453af8f
omissions from 9899:9f25290a35e8
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
33 |
2929c453af8f
omissions from 9899:9f25290a35e8
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
34 for i = 1 : numel (data) |
2929c453af8f
omissions from 9899:9f25290a35e8
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
35 addproperty (strcat (data{i}, "datasource"), h, "string", ""); |
2929c453af8f
omissions from 9899:9f25290a35e8
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
36 endfor |
2929c453af8f
omissions from 9899:9f25290a35e8
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
37 |
2929c453af8f
omissions from 9899:9f25290a35e8
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
38 i = 0; |
2929c453af8f
omissions from 9899:9f25290a35e8
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
39 newargs = {}; |
2929c453af8f
omissions from 9899:9f25290a35e8
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
40 while (i < numel (varargin)) |
2929c453af8f
omissions from 9899:9f25290a35e8
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
41 arg = varargin{++i}; |
14868
5d3a684236b0
maint: Use Octave coding conventions for cuddling parentheses in scripts directory
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
42 if (i != numel (varargin) && ischar (arg) |
10549 | 43 && length (arg) > 9 && strcmpi (arg(end-9:end), "datasource")) |
9902
2929c453af8f
omissions from 9899:9f25290a35e8
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
44 arg = tolower (arg); |
2929c453af8f
omissions from 9899:9f25290a35e8
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
45 val = varargin{++i}; |
2929c453af8f
omissions from 9899:9f25290a35e8
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
46 if (ischar (val)) |
10549 | 47 set (h, arg, val); |
9902
2929c453af8f
omissions from 9899:9f25290a35e8
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
48 else |
10549 | 49 error ("%s: expecting data source to be a string", fcn); |
9902
2929c453af8f
omissions from 9899:9f25290a35e8
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
50 endif |
2929c453af8f
omissions from 9899:9f25290a35e8
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
51 else |
2929c453af8f
omissions from 9899:9f25290a35e8
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
52 newargs{end + 1} = arg; |
2929c453af8f
omissions from 9899:9f25290a35e8
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
53 endif |
2929c453af8f
omissions from 9899:9f25290a35e8
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
54 endwhile |
2929c453af8f
omissions from 9899:9f25290a35e8
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
55 endfunction |