Mercurial > hg > octave-lyh
annotate scripts/plot/__pltopt__.m @ 8920:eb63fbe60fab
update copyright notices
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sat, 07 Mar 2009 10:41:27 -0500 |
parents | 7d48766c21a5 |
children |
rev | line source |
---|---|
7017 | 1 ## Copyright (C) 1994, 1995, 1996, 1997, 1998, 2000, 2002, 2004, 2005, |
8920 | 2 ## 2006, 2007, 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/>. | |
933 | 19 |
8812
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
20 ## -*- texinfo -*- |
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
21 ## @deftypefn {Function File} {} __pltopt__ (@var{caller}, @var{opt}) |
6895 | 22 ## Undocumented internal function. |
8812
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
23 ## @end deftypefn |
6895 | 24 |
3500 | 25 ## @deftypefn {Function File} {} __pltopt__ (@var{caller}, @var{opt}) |
6895 | 26 ## |
2311 | 27 ## Decode plot option strings. |
28 ## | |
3449 | 29 ## @var{opt} can currently be some combination of the following: |
2311 | 30 ## |
3449 | 31 ## @table @code |
32 ## @item "-" | |
6267 | 33 ## For solid linestyle (default). |
3717 | 34 ## |
6267 | 35 ## @item "--" |
36 ## For dashed line style. | |
3717 | 37 ## |
6267 | 38 ## @item "-." |
3717 | 39 ## For linespoints plot style. |
40 ## | |
6267 | 41 ## @item ":" |
42 ## For dots plot style. | |
3717 | 43 ## |
6267 | 44 ## @item "r" |
45 ## Red line color. | |
3717 | 46 ## |
6267 | 47 ## @item "g" |
48 ## Green line color. | |
3717 | 49 ## |
6267 | 50 ## @item "b" |
51 ## Blue line color. | |
3717 | 52 ## |
6267 | 53 ## @item "c" |
54 ## Cyan line color. | |
3717 | 55 ## |
6267 | 56 ## @item "m" |
57 ## Magenta line color. | |
4006 | 58 ## |
6267 | 59 ## @item "y" |
60 ## Yellow line color. | |
3717 | 61 ## |
6267 | 62 ## @item "k" |
63 ## Black line color. | |
3717 | 64 ## |
6267 | 65 ## @item "w" |
66 ## White line color. | |
3717 | 67 ## |
3449 | 68 ## @item ";title;" |
69 ## Here @code{"title"} is the label for the key. | |
3717 | 70 ## |
6267 | 71 ## @item "+" |
72 ## @itemx "o" | |
73 ## @itemx "*" | |
74 ## @itemx "." | |
75 ## @itemx "x" | |
76 ## @itemx "s" | |
77 ## @itemx "d" | |
78 ## @itemx "^" | |
79 ## @itemx "v" | |
80 ## @itemx ">" | |
81 ## @itemx "<" | |
82 ## @itemx "p" | |
83 ## @itemx "h" | |
3717 | 84 ## Used in combination with the points or linespoints styles, set the point |
85 ## style. | |
3449 | 86 ## @end table |
2311 | 87 ## |
3449 | 88 ## The legend may be fixed to include the name of the variable |
89 ## plotted in some future version of Octave. | |
933 | 90 |
3162 | 91 ## Author: jwe |
2314 | 92 |
6459 | 93 function [options, valid] = __pltopt__ (caller, opt, err_on_invalid) |
94 | |
95 valid = true; | |
96 options = __default_plot_options__ (); | |
933 | 97 |
6459 | 98 if ((nargin == 2 || nargin == 3) && (nargout == 1 || nargout == 2)) |
99 if (nargin == 2) | |
100 err_on_invalid = true; | |
101 endif | |
6146 | 102 if (ischar (opt)) |
103 nel = rows (opt); | |
104 elseif (iscellstr (opt)) | |
105 nel = numel (opt); | |
106 else | |
107 error ("__pltopt__: expecting argument to be character string or cell array of character strings"); | |
108 endif | |
109 if (ischar (opt)) | |
110 opt = cellstr (opt); | |
111 endif | |
6264 | 112 for i = nel:-1:1 |
6459 | 113 [options(i), valid] = __pltopt1__ (caller, opt{i}, err_on_invalid); |
114 if (! err_on_invalid && ! valid) | |
115 return; | |
116 endif | |
6146 | 117 endfor |
118 else | |
6046 | 119 print_usage (); |
933 | 120 endif |
121 | |
122 endfunction |