comparison scripts/plot/plot_border.m @ 1540:749b8b19733f

[project @ 1995-10-06 03:10:34 by jwe] Initial revision
author jwe
date Fri, 06 Oct 1995 03:10:34 +0000
parents
children c694fe5956e3
comparison
equal deleted inserted replaced
1539:4914a8b34fd0 1540:749b8b19733f
1 # Copyright (C) 1995 John W. Eaton
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 the
7 # Free Software Foundation; either version 2, or (at your option) any
8 # later version.
9 #
10 # Octave is distributed in the hope that it will be useful, but WITHOUT
11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 # 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.
19
20 function plot_border (...)
21
22 # usage: plot_border (...)
23 #
24 # NOTE: this will work only with gnuplot installed with
25 # multiplot patch
26 #
27 # Multiple arguments allowed to specify the sides on which the border
28 # is shown. allowed strings:
29 #
30 # allowed input strings:
31 #
32 # "blank", "BLANK", "b", "B", ---> No borders displayed
33 # "all", "ALL", "a", "A", ---> All borders displayed
34 # "north", "NORTH", "n", "N", ---> North Border
35 # "south", "SOUTH", "s", "S", ---> South Border
36 # "east", "EAST", "e", "E", ---> East Border
37 # "west", "WEST", "w", "W", ---> West Border
38 #
39 # Without any arguments, turns borders off.
40
41 # Written by Vinayak Dutt, Dutt.Vinayak@mayo.EDU 3 Jul 95
42
43 south = 0;
44 west = 0;
45 north = 0;
46 east = 0;
47 all = 0;
48 none = 1;
49
50 va_start ();
51
52 while (nargin--)
53
54 arg = va_arg ();
55
56 if (! isstr (arg))
57 error ("plot_border: input not a string");
58 endif
59
60 # The effect of the arguments in cumulative. If something is found
61 # after "b", do that and ignore "b".
62
63 if (strcmp (arg, "blank") || strcmp (arg, "BLANK")
64 || strcmp (arg, "b") || strcmp (arg, "B"))
65 none = 1;
66 else
67 none = 0;
68 if (strcmp (arg, "south") || strcmp (arg, "SOUTH")
69 || strcmp (arg, "s") || strcmp (arg, "S"))
70 south = 1;
71 elseif (strcmp (arg, "west") || strcmp (arg, "WEST")
72 || strcmp (arg, "w") || strcmp (arg, "W"))
73 west = 2;
74 elseif (strcmp (arg, "north") || strcmp (arg, "NORTH")
75 || strcmp (arg, "n") || strcmp (arg, "N"))
76 north = 4;
77 elseif (strcmp (arg, "east") || strcmp (arg, "EAST")
78 || strcmp (arg, "e") || strcmp (arg, "E"))
79 east = 8;
80 elseif (strcmp (arg, "all") || strcmp (arg, "ALL")
81 || strcmp (arg, "a") || strcmp (arg, "A"))
82 all = 1;
83 endif
84 endif
85 endwhile
86
87 if (none)
88 set noborder
89 else
90 if (all)
91 border = 15;
92 else
93 border = south + west + north + east;
94 endif
95 eval (sprintf ("set border %d", border));
96 endif
97
98 endfunction