annotate scripts/plot/__pltopt__.m @ 3162:7c96e85c76db

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