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