2847
|
1 ## Copyright (C) 1996, 1997 John W. Eaton |
2313
|
2 ## |
|
3 ## This file is part of Octave. |
|
4 ## |
|
5 ## Octave is free software; you can redistribute it and/or modify it |
|
6 ## under the terms of the GNU General Public License as published by |
|
7 ## the Free Software Foundation; either version 2, or (at your option) |
|
8 ## any later version. |
|
9 ## |
|
10 ## Octave is distributed in the hope that it will be useful, but |
|
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
13 ## General Public License for more details. |
|
14 ## |
|
15 ## You should have received a copy of the GNU General Public License |
|
16 ## along with Octave; see the file COPYING. If not, write to the Free |
5307
|
17 ## Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|
18 ## 02110-1301, USA. |
933
|
19 |
3449
|
20 ## -*- texinfo -*- |
3500
|
21 ## @deftypefn {Function File} {} __pltopt__ (@var{caller}, @var{opt}) |
2311
|
22 ## Decode plot option strings. |
|
23 ## |
3449
|
24 ## @var{opt} can currently be some combination of the following: |
2311
|
25 ## |
3449
|
26 ## @table @code |
|
27 ## @item "-" |
6267
|
28 ## For solid linestyle (default). |
3717
|
29 ## |
6267
|
30 ## @item "--" |
|
31 ## For dashed line style. |
3717
|
32 ## |
6267
|
33 ## @item "-." |
3717
|
34 ## For linespoints plot style. |
|
35 ## |
6267
|
36 ## @item ":" |
|
37 ## For dots plot style. |
3717
|
38 ## |
6267
|
39 ## @item "r" |
|
40 ## Red line color. |
3717
|
41 ## |
6267
|
42 ## @item "g" |
|
43 ## Green line color. |
3717
|
44 ## |
6267
|
45 ## @item "b" |
|
46 ## Blue line color. |
3717
|
47 ## |
6267
|
48 ## @item "c" |
|
49 ## Cyan line color. |
3717
|
50 ## |
6267
|
51 ## @item "m" |
|
52 ## Magenta line color. |
4006
|
53 ## |
6267
|
54 ## @item "y" |
|
55 ## Yellow line color. |
3717
|
56 ## |
6267
|
57 ## @item "k" |
|
58 ## Black line color. |
3717
|
59 ## |
6267
|
60 ## @item "w" |
|
61 ## White line color. |
3717
|
62 ## |
3449
|
63 ## @item ";title;" |
|
64 ## Here @code{"title"} is the label for the key. |
3717
|
65 ## |
6267
|
66 ## @item "+" |
|
67 ## @itemx "o" |
|
68 ## @itemx "*" |
|
69 ## @itemx "." |
|
70 ## @itemx "x" |
|
71 ## @itemx "s" |
|
72 ## @itemx "d" |
|
73 ## @itemx "^" |
|
74 ## @itemx "v" |
|
75 ## @itemx ">" |
|
76 ## @itemx "<" |
|
77 ## @itemx "p" |
|
78 ## @itemx "h" |
3717
|
79 ## Used in combination with the points or linespoints styles, set the point |
|
80 ## style. |
3449
|
81 ## @end table |
2311
|
82 ## |
3449
|
83 ## The legend may be fixed to include the name of the variable |
|
84 ## plotted in some future version of Octave. |
|
85 ## |
5642
|
86 ## @seealso{__pltopt1__} |
3449
|
87 ## @end deftypefn |
933
|
88 |
3162
|
89 ## Author: jwe |
2314
|
90 |
6264
|
91 function options = __pltopt__ (caller, opt) |
933
|
92 |
6264
|
93 if (nargin == 2 && nargout == 1) |
6146
|
94 if (ischar (opt)) |
|
95 nel = rows (opt); |
|
96 elseif (iscellstr (opt)) |
|
97 nel = numel (opt); |
|
98 else |
|
99 error ("__pltopt__: expecting argument to be character string or cell array of character strings"); |
|
100 endif |
|
101 if (ischar (opt)) |
|
102 opt = cellstr (opt); |
|
103 endif |
6264
|
104 for i = nel:-1:1 |
|
105 options(i) = __pltopt1__ (caller, opt{i}); |
6146
|
106 endfor |
|
107 else |
6046
|
108 print_usage (); |
933
|
109 endif |
|
110 |
|
111 endfunction |