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 |
|
17 ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA |
|
18 ## 02111-1307, 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 ## If @var{opt} is a valid option string, return a string of the form |
|
25 ## @code{"w l 2"} ("with lines 2"). Uses abbreviations for the options |
|
26 ## to avoid overrunning gnuplot's command line buffer unnecessarily. |
2311
|
27 ## |
3449
|
28 ## @var{opt} can currently be some combination of the following: |
2311
|
29 ## |
3449
|
30 ## @table @code |
|
31 ## @item "-" |
|
32 ## For lines plot style (default). |
3717
|
33 ## |
3449
|
34 ## @item "." |
|
35 ## For dots plot style. |
3717
|
36 ## |
3449
|
37 ## @item "@" |
|
38 ## For points plot style. |
3717
|
39 ## |
3449
|
40 ## @item "-@" |
3717
|
41 ## For linespoints plot style. |
|
42 ## |
3449
|
43 ## @item "^" |
|
44 ## For impulses plot style. |
3717
|
45 ## |
3449
|
46 ## @item "L" |
|
47 ## For steps plot style. |
3717
|
48 ## |
3449
|
49 ## @item "#" |
|
50 ## For boxes plot style. |
3717
|
51 ## |
3449
|
52 ## @item "~" |
3717
|
53 ## For yerrorbars plot style. |
|
54 ## |
|
55 ## @item ">" |
|
56 ## For xerrorbars plot style. |
|
57 ## |
|
58 ## @item "~>" |
|
59 ## For xyerrorbars plot style. |
|
60 ## |
3449
|
61 ## @item "#~" |
|
62 ## For boxerrorbars plot style. |
3717
|
63 ## |
4006
|
64 ## @item "#~>" |
|
65 ## For boxxyerrorbars plot style. |
|
66 ## |
3449
|
67 ## @item "n" |
|
68 ## With @code{n} in 1-6 (wraps at 8), plot color |
3717
|
69 ## |
3449
|
70 ## @item "nm" |
|
71 ## With @code{m} in 1-6 (wraps at 6), point style (only valid for @code{"@"} or |
|
72 ## @code{"-@"}) |
3717
|
73 ## |
3449
|
74 ## @item @var{c} |
|
75 ## Where @var{c} is one of @code{"r"}, @code{"g"}, @code{"b"}, @code{"m"}, |
|
76 ## @code{"c"}, or @code{"w"} colors. |
3717
|
77 ## |
3449
|
78 ## @item ";title;" |
|
79 ## Here @code{"title"} is the label for the key. |
3717
|
80 ## |
|
81 ## @item + |
|
82 ## @itemx * |
|
83 ## @itemx o |
|
84 ## @itemx x |
|
85 ## Used in combination with the points or linespoints styles, set the point |
|
86 ## style. |
3449
|
87 ## @end table |
2311
|
88 ## |
3449
|
89 ## The legend may be fixed to include the name of the variable |
|
90 ## plotted in some future version of Octave. |
|
91 ## |
|
92 ## The colors, line styles, and point styles have the following |
|
93 ## meanings for X11 and Postscript terminals under Gnuplot 3.6. |
3162
|
94 ## |
3449
|
95 ## @example |
|
96 ## Number ------ Color ------- Line Style ---- Points Style ---- |
|
97 ## x11 postscript postscript x11 postscript |
|
98 ## ===================================================================== |
|
99 ## 1 red green solid "o" "+" |
|
100 ## 2 green blue long dash "+" "x" |
|
101 ## 3 blue red short dash square "*" |
|
102 ## 4 magenta magenta dotted "x" open square |
|
103 ## 5 cyan cyan dot long dash triangle filled square |
|
104 ## 6 brown yellow dot short dash "*" "o" |
|
105 ## @end example |
|
106 ## @end deftypefn |
3407
|
107 ## @seealso{__pltopt1__} |
933
|
108 |
3162
|
109 ## Author: jwe |
2314
|
110 |
2315
|
111 function fmt = __pltopt__ (caller, opt) |
933
|
112 |
|
113 if (! isstr (opt)) |
3162
|
114 usage ("__pltopt__ (caller, opt)"); |
933
|
115 endif |
|
116 |
3162
|
117 nr = rows (opt); |
|
118 fmt = ""; |
|
119 for i = 1:nr |
|
120 t = __pltopt1__ (caller, deblank (opt(i,:))); |
|
121 fmt(i,1:length(t)) = t; |
|
122 endfor |
933
|
123 |
|
124 endfunction |