annotate scripts/plot/__pltopt__.m @ 6046:34f96dd5441b

[project @ 2006-10-10 16:10:25 by jwe]
author jwe
date Tue, 10 Oct 2006 16:10:31 +0000
parents 2618a0750ae6
children 1a6d826e92b5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2847
8b262e771614 [project @ 1997-03-27 16:18:26 by jwe]
jwe
parents: 2697
diff changeset
1 ## Copyright (C) 1996, 1997 John W. Eaton
2313
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2311
diff changeset
2 ##
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2311
diff changeset
3 ## This file is part of Octave.
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2311
diff changeset
4 ##
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2311
diff changeset
5 ## Octave is free software; you can redistribute it and/or modify it
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2311
diff changeset
6 ## under the terms of the GNU General Public License as published by
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2311
diff changeset
7 ## the Free Software Foundation; either version 2, or (at your option)
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2311
diff changeset
8 ## any later version.
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2311
diff changeset
9 ##
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2311
diff changeset
10 ## Octave is distributed in the hope that it will be useful, but
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2311
diff changeset
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2311
diff changeset
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2311
diff changeset
13 ## General Public License for more details.
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2311
diff changeset
14 ##
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2311
diff changeset
15 ## You should have received a copy of the GNU General Public License
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2311
diff changeset
16 ## along with Octave; see the file COPYING. If not, write to the Free
5307
4c8a2e4e0717 [project @ 2005-04-26 19:24:27 by jwe]
jwe
parents: 5053
diff changeset
17 ## Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
4c8a2e4e0717 [project @ 2005-04-26 19:24:27 by jwe]
jwe
parents: 5053
diff changeset
18 ## 02110-1301, USA.
933
598a3aa40360 [project @ 1994-11-17 04:23:41 by jwe]
jwe
parents:
diff changeset
19
3449
858695b3ed62 [project @ 2000-01-18 04:08:59 by jwe]
jwe
parents: 3426
diff changeset
20 ## -*- texinfo -*-
3500
7923abdeb4e5 [project @ 2000-01-31 06:35:00 by jwe]
jwe
parents: 3449
diff changeset
21 ## @deftypefn {Function File} {} __pltopt__ (@var{caller}, @var{opt})
2311
2b5788792cad [project @ 1996-07-11 20:18:38 by jwe]
jwe
parents: 2303
diff changeset
22 ## Decode plot option strings.
2b5788792cad [project @ 1996-07-11 20:18:38 by jwe]
jwe
parents: 2303
diff changeset
23 ##
3449
858695b3ed62 [project @ 2000-01-18 04:08:59 by jwe]
jwe
parents: 3426
diff changeset
24 ## If @var{opt} is a valid option string, return a string of the form
858695b3ed62 [project @ 2000-01-18 04:08:59 by jwe]
jwe
parents: 3426
diff changeset
25 ## @code{"w l 2"} ("with lines 2"). Uses abbreviations for the options
858695b3ed62 [project @ 2000-01-18 04:08:59 by jwe]
jwe
parents: 3426
diff changeset
26 ## to avoid overrunning gnuplot's command line buffer unnecessarily.
2311
2b5788792cad [project @ 1996-07-11 20:18:38 by jwe]
jwe
parents: 2303
diff changeset
27 ##
3449
858695b3ed62 [project @ 2000-01-18 04:08:59 by jwe]
jwe
parents: 3426
diff changeset
28 ## @var{opt} can currently be some combination of the following:
2311
2b5788792cad [project @ 1996-07-11 20:18:38 by jwe]
jwe
parents: 2303
diff changeset
29 ##
3449
858695b3ed62 [project @ 2000-01-18 04:08:59 by jwe]
jwe
parents: 3426
diff changeset
30 ## @table @code
858695b3ed62 [project @ 2000-01-18 04:08:59 by jwe]
jwe
parents: 3426
diff changeset
31 ## @item "-"
858695b3ed62 [project @ 2000-01-18 04:08:59 by jwe]
jwe
parents: 3426
diff changeset
32 ## For lines plot style (default).
3717
e3501697c995 [project @ 2000-09-08 06:27:44 by jwe]
jwe
parents: 3500
diff changeset
33 ##
3449
858695b3ed62 [project @ 2000-01-18 04:08:59 by jwe]
jwe
parents: 3426
diff changeset
34 ## @item "."
858695b3ed62 [project @ 2000-01-18 04:08:59 by jwe]
jwe
parents: 3426
diff changeset
35 ## For dots plot style.
3717
e3501697c995 [project @ 2000-09-08 06:27:44 by jwe]
jwe
parents: 3500
diff changeset
36 ##
4898
8fd9495f5054 [project @ 2004-06-04 13:29:33 by jwe]
jwe
parents: 4006
diff changeset
37 ## @item "@@"
3449
858695b3ed62 [project @ 2000-01-18 04:08:59 by jwe]
jwe
parents: 3426
diff changeset
38 ## For points plot style.
3717
e3501697c995 [project @ 2000-09-08 06:27:44 by jwe]
jwe
parents: 3500
diff changeset
39 ##
4898
8fd9495f5054 [project @ 2004-06-04 13:29:33 by jwe]
jwe
parents: 4006
diff changeset
40 ## @item "-@@"
3717
e3501697c995 [project @ 2000-09-08 06:27:44 by jwe]
jwe
parents: 3500
diff changeset
41 ## For linespoints plot style.
e3501697c995 [project @ 2000-09-08 06:27:44 by jwe]
jwe
parents: 3500
diff changeset
42 ##
3449
858695b3ed62 [project @ 2000-01-18 04:08:59 by jwe]
jwe
parents: 3426
diff changeset
43 ## @item "^"
858695b3ed62 [project @ 2000-01-18 04:08:59 by jwe]
jwe
parents: 3426
diff changeset
44 ## For impulses plot style.
3717
e3501697c995 [project @ 2000-09-08 06:27:44 by jwe]
jwe
parents: 3500
diff changeset
45 ##
3449
858695b3ed62 [project @ 2000-01-18 04:08:59 by jwe]
jwe
parents: 3426
diff changeset
46 ## @item "L"
858695b3ed62 [project @ 2000-01-18 04:08:59 by jwe]
jwe
parents: 3426
diff changeset
47 ## For steps plot style.
3717
e3501697c995 [project @ 2000-09-08 06:27:44 by jwe]
jwe
parents: 3500
diff changeset
48 ##
3449
858695b3ed62 [project @ 2000-01-18 04:08:59 by jwe]
jwe
parents: 3426
diff changeset
49 ## @item "#"
858695b3ed62 [project @ 2000-01-18 04:08:59 by jwe]
jwe
parents: 3426
diff changeset
50 ## For boxes plot style.
3717
e3501697c995 [project @ 2000-09-08 06:27:44 by jwe]
jwe
parents: 3500
diff changeset
51 ##
3449
858695b3ed62 [project @ 2000-01-18 04:08:59 by jwe]
jwe
parents: 3426
diff changeset
52 ## @item "~"
3717
e3501697c995 [project @ 2000-09-08 06:27:44 by jwe]
jwe
parents: 3500
diff changeset
53 ## For yerrorbars plot style.
e3501697c995 [project @ 2000-09-08 06:27:44 by jwe]
jwe
parents: 3500
diff changeset
54 ##
e3501697c995 [project @ 2000-09-08 06:27:44 by jwe]
jwe
parents: 3500
diff changeset
55 ## @item ">"
e3501697c995 [project @ 2000-09-08 06:27:44 by jwe]
jwe
parents: 3500
diff changeset
56 ## For xerrorbars plot style.
e3501697c995 [project @ 2000-09-08 06:27:44 by jwe]
jwe
parents: 3500
diff changeset
57 ##
e3501697c995 [project @ 2000-09-08 06:27:44 by jwe]
jwe
parents: 3500
diff changeset
58 ## @item "~>"
e3501697c995 [project @ 2000-09-08 06:27:44 by jwe]
jwe
parents: 3500
diff changeset
59 ## For xyerrorbars plot style.
e3501697c995 [project @ 2000-09-08 06:27:44 by jwe]
jwe
parents: 3500
diff changeset
60 ##
3449
858695b3ed62 [project @ 2000-01-18 04:08:59 by jwe]
jwe
parents: 3426
diff changeset
61 ## @item "#~"
858695b3ed62 [project @ 2000-01-18 04:08:59 by jwe]
jwe
parents: 3426
diff changeset
62 ## For boxerrorbars plot style.
3717
e3501697c995 [project @ 2000-09-08 06:27:44 by jwe]
jwe
parents: 3500
diff changeset
63 ##
4006
efac4b97bb09 [project @ 2002-07-26 01:20:46 by jwe]
jwe
parents: 3717
diff changeset
64 ## @item "#~>"
efac4b97bb09 [project @ 2002-07-26 01:20:46 by jwe]
jwe
parents: 3717
diff changeset
65 ## For boxxyerrorbars plot style.
efac4b97bb09 [project @ 2002-07-26 01:20:46 by jwe]
jwe
parents: 3717
diff changeset
66 ##
3449
858695b3ed62 [project @ 2000-01-18 04:08:59 by jwe]
jwe
parents: 3426
diff changeset
67 ## @item "n"
858695b3ed62 [project @ 2000-01-18 04:08:59 by jwe]
jwe
parents: 3426
diff changeset
68 ## With @code{n} in 1-6 (wraps at 8), plot color
3717
e3501697c995 [project @ 2000-09-08 06:27:44 by jwe]
jwe
parents: 3500
diff changeset
69 ##
3449
858695b3ed62 [project @ 2000-01-18 04:08:59 by jwe]
jwe
parents: 3426
diff changeset
70 ## @item "nm"
4898
8fd9495f5054 [project @ 2004-06-04 13:29:33 by jwe]
jwe
parents: 4006
diff changeset
71 ## With @code{m} in 1-6 (wraps at 6), point style (only valid for @code{"@@"} or
8fd9495f5054 [project @ 2004-06-04 13:29:33 by jwe]
jwe
parents: 4006
diff changeset
72 ## @code{"-@@"})
3717
e3501697c995 [project @ 2000-09-08 06:27:44 by jwe]
jwe
parents: 3500
diff changeset
73 ##
3449
858695b3ed62 [project @ 2000-01-18 04:08:59 by jwe]
jwe
parents: 3426
diff changeset
74 ## @item @var{c}
858695b3ed62 [project @ 2000-01-18 04:08:59 by jwe]
jwe
parents: 3426
diff changeset
75 ## Where @var{c} is one of @code{"r"}, @code{"g"}, @code{"b"}, @code{"m"},
858695b3ed62 [project @ 2000-01-18 04:08:59 by jwe]
jwe
parents: 3426
diff changeset
76 ## @code{"c"}, or @code{"w"} colors.
3717
e3501697c995 [project @ 2000-09-08 06:27:44 by jwe]
jwe
parents: 3500
diff changeset
77 ##
3449
858695b3ed62 [project @ 2000-01-18 04:08:59 by jwe]
jwe
parents: 3426
diff changeset
78 ## @item ";title;"
858695b3ed62 [project @ 2000-01-18 04:08:59 by jwe]
jwe
parents: 3426
diff changeset
79 ## Here @code{"title"} is the label for the key.
3717
e3501697c995 [project @ 2000-09-08 06:27:44 by jwe]
jwe
parents: 3500
diff changeset
80 ##
e3501697c995 [project @ 2000-09-08 06:27:44 by jwe]
jwe
parents: 3500
diff changeset
81 ## @item +
e3501697c995 [project @ 2000-09-08 06:27:44 by jwe]
jwe
parents: 3500
diff changeset
82 ## @itemx *
e3501697c995 [project @ 2000-09-08 06:27:44 by jwe]
jwe
parents: 3500
diff changeset
83 ## @itemx o
e3501697c995 [project @ 2000-09-08 06:27:44 by jwe]
jwe
parents: 3500
diff changeset
84 ## @itemx x
e3501697c995 [project @ 2000-09-08 06:27:44 by jwe]
jwe
parents: 3500
diff changeset
85 ## Used in combination with the points or linespoints styles, set the point
e3501697c995 [project @ 2000-09-08 06:27:44 by jwe]
jwe
parents: 3500
diff changeset
86 ## style.
3449
858695b3ed62 [project @ 2000-01-18 04:08:59 by jwe]
jwe
parents: 3426
diff changeset
87 ## @end table
2311
2b5788792cad [project @ 1996-07-11 20:18:38 by jwe]
jwe
parents: 2303
diff changeset
88 ##
3449
858695b3ed62 [project @ 2000-01-18 04:08:59 by jwe]
jwe
parents: 3426
diff changeset
89 ## The legend may be fixed to include the name of the variable
858695b3ed62 [project @ 2000-01-18 04:08:59 by jwe]
jwe
parents: 3426
diff changeset
90 ## plotted in some future version of Octave.
858695b3ed62 [project @ 2000-01-18 04:08:59 by jwe]
jwe
parents: 3426
diff changeset
91 ##
858695b3ed62 [project @ 2000-01-18 04:08:59 by jwe]
jwe
parents: 3426
diff changeset
92 ## The colors, line styles, and point styles have the following
858695b3ed62 [project @ 2000-01-18 04:08:59 by jwe]
jwe
parents: 3426
diff changeset
93 ## meanings for X11 and Postscript terminals under Gnuplot 3.6.
3162
7c96e85c76db [project @ 1998-04-08 18:19:35 by jwe]
jwe
parents: 3101
diff changeset
94 ##
3449
858695b3ed62 [project @ 2000-01-18 04:08:59 by jwe]
jwe
parents: 3426
diff changeset
95 ## @example
858695b3ed62 [project @ 2000-01-18 04:08:59 by jwe]
jwe
parents: 3426
diff changeset
96 ## Number ------ Color ------- Line Style ---- Points Style ----
858695b3ed62 [project @ 2000-01-18 04:08:59 by jwe]
jwe
parents: 3426
diff changeset
97 ## x11 postscript postscript x11 postscript
858695b3ed62 [project @ 2000-01-18 04:08:59 by jwe]
jwe
parents: 3426
diff changeset
98 ## =====================================================================
858695b3ed62 [project @ 2000-01-18 04:08:59 by jwe]
jwe
parents: 3426
diff changeset
99 ## 1 red green solid "o" "+"
858695b3ed62 [project @ 2000-01-18 04:08:59 by jwe]
jwe
parents: 3426
diff changeset
100 ## 2 green blue long dash "+" "x"
858695b3ed62 [project @ 2000-01-18 04:08:59 by jwe]
jwe
parents: 3426
diff changeset
101 ## 3 blue red short dash square "*"
858695b3ed62 [project @ 2000-01-18 04:08:59 by jwe]
jwe
parents: 3426
diff changeset
102 ## 4 magenta magenta dotted "x" open square
858695b3ed62 [project @ 2000-01-18 04:08:59 by jwe]
jwe
parents: 3426
diff changeset
103 ## 5 cyan cyan dot long dash triangle filled square
858695b3ed62 [project @ 2000-01-18 04:08:59 by jwe]
jwe
parents: 3426
diff changeset
104 ## 6 brown yellow dot short dash "*" "o"
858695b3ed62 [project @ 2000-01-18 04:08:59 by jwe]
jwe
parents: 3426
diff changeset
105 ## @end example
5642
2618a0750ae6 [project @ 2006-03-06 21:26:48 by jwe]
jwe
parents: 5443
diff changeset
106 ## @seealso{__pltopt1__}
3449
858695b3ed62 [project @ 2000-01-18 04:08:59 by jwe]
jwe
parents: 3426
diff changeset
107 ## @end deftypefn
933
598a3aa40360 [project @ 1994-11-17 04:23:41 by jwe]
jwe
parents:
diff changeset
108
3162
7c96e85c76db [project @ 1998-04-08 18:19:35 by jwe]
jwe
parents: 3101
diff changeset
109 ## Author: jwe
2314
949ab8eba8bc [project @ 1996-07-12 03:58:02 by jwe]
jwe
parents: 2313
diff changeset
110
2315
bf8b1bffb58f [project @ 1996-07-12 17:22:07 by jwe]
jwe
parents: 2314
diff changeset
111 function fmt = __pltopt__ (caller, opt)
933
598a3aa40360 [project @ 1994-11-17 04:23:41 by jwe]
jwe
parents:
diff changeset
112
5443
ec8c33dcd1bf [project @ 2005-09-08 01:40:57 by jwe]
jwe
parents: 5307
diff changeset
113 if (! ischar (opt))
6046
34f96dd5441b [project @ 2006-10-10 16:10:25 by jwe]
jwe
parents: 5642
diff changeset
114 print_usage ();
933
598a3aa40360 [project @ 1994-11-17 04:23:41 by jwe]
jwe
parents:
diff changeset
115 endif
598a3aa40360 [project @ 1994-11-17 04:23:41 by jwe]
jwe
parents:
diff changeset
116
3162
7c96e85c76db [project @ 1998-04-08 18:19:35 by jwe]
jwe
parents: 3101
diff changeset
117 nr = rows (opt);
7c96e85c76db [project @ 1998-04-08 18:19:35 by jwe]
jwe
parents: 3101
diff changeset
118 fmt = "";
7c96e85c76db [project @ 1998-04-08 18:19:35 by jwe]
jwe
parents: 3101
diff changeset
119 for i = 1:nr
7c96e85c76db [project @ 1998-04-08 18:19:35 by jwe]
jwe
parents: 3101
diff changeset
120 t = __pltopt1__ (caller, deblank (opt(i,:)));
7c96e85c76db [project @ 1998-04-08 18:19:35 by jwe]
jwe
parents: 3101
diff changeset
121 fmt(i,1:length(t)) = t;
7c96e85c76db [project @ 1998-04-08 18:19:35 by jwe]
jwe
parents: 3101
diff changeset
122 endfor
933
598a3aa40360 [project @ 1994-11-17 04:23:41 by jwe]
jwe
parents:
diff changeset
123
598a3aa40360 [project @ 1994-11-17 04:23:41 by jwe]
jwe
parents:
diff changeset
124 endfunction