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 |
2315
|
20 ## usage: fmt = __pltopt__ (caller, opt) |
2311
|
21 ## |
|
22 ## Decode plot option strings. |
|
23 ## |
|
24 ## If OPT is a valid option string, return a string of the form "w l 2" |
|
25 ## ("with lines 2"). Uses abbreviations for the options to avoid |
|
26 ## overrunning gnuplot's command line buffer unnecessarily. |
|
27 ## |
|
28 ## OPT can currently be some combination of the following: |
|
29 ## |
|
30 ## "-" for lines plot style (default). |
|
31 ## "." for dots plot style. |
|
32 ## "@" for points plot style. |
|
33 ## "-@" for linespoints plot style. |
|
34 ## "^" for impulses plot style. |
|
35 ## "L" for steps plot style. |
|
36 ## "#" for boxes plot style. |
|
37 ## "~" for errorbars plot style. |
|
38 ## "#~" for boxerrorbars plot style. |
|
39 ## "n" with n in 1-6 (wraps at 8), plot color |
2697
|
40 ## "nm" with m in 1-6 (wraps at 6), point style (only valid for "@" or "-@") |
2311
|
41 ## "c" where c is one of ["r", "g", "b", "m", "c", "w"] colors. |
3062
|
42 ## ";title;" where "title" is the label for the key. |
2311
|
43 ## |
|
44 ## Special points formats: |
|
45 ## |
3062
|
46 ## "+", "*", "o", "x" will display points in that style for term x11. |
2311
|
47 ## |
|
48 ## The legend may be fixed to include the name of the variable |
|
49 ## plotted in some future version of Octave. |
|
50 ## |
3062
|
51 ## The colors, line styles, and point styles have the following |
|
52 ## meanings for X11 and Postscript terminals under Gnuplot 3.6. |
2311
|
53 ## |
3062
|
54 ## Number ------ Color ------- Line Style ---- Points Style ---- |
|
55 ## x11 postscript postscript x11 postscript |
|
56 ## ===================================================================== |
|
57 ## 1 red green solid "o" "+" |
|
58 ## 2 green blue long dash "+" "x" |
|
59 ## 3 blue red short dash square "*" |
|
60 ## 4 magenta magenta dotted "x" open square |
|
61 ## 5 cyan cyan dot long dash triangle filled square |
|
62 ## 6 brown yellow dot short dash "*" "o" |
3162
|
63 ## |
|
64 ## See also: __pltopt1__ |
933
|
65 |
3162
|
66 ## Author: jwe |
2697
|
67 ## Adapted-By: jwe |
|
68 ## Maintainer: jwe |
2314
|
69 |
2315
|
70 function fmt = __pltopt__ (caller, opt) |
933
|
71 |
|
72 if (! isstr (opt)) |
3162
|
73 usage ("__pltopt__ (caller, opt)"); |
933
|
74 endif |
|
75 |
3162
|
76 nr = rows (opt); |
|
77 fmt = ""; |
|
78 for i = 1:nr |
|
79 t = __pltopt1__ (caller, deblank (opt(i,:))); |
|
80 fmt(i,1:length(t)) = t; |
|
81 endfor |
933
|
82 |
|
83 endfunction |