comparison scripts/plot/orient.m @ 5365:c9c773d8333f

[project @ 2005-05-23 20:05:15 by jwe]
author jwe
date Mon, 23 May 2005 20:05:15 +0000
parents dd230a6f68f6
children 34f96dd5441b
comparison
equal deleted inserted replaced
5364:dd230a6f68f6 5365:c9c773d8333f
1 ## Copyright (C) 2001 Paul Kienzle 1 ## Copyright (C) 2001 Paul Kienzle
2 ## 2 ##
3 ## This program is free software; you can redistribute it and/or modify 3 ## This file is part of Octave.
4 ## it under the terms of the GNU General Public License as published by
5 ## the Free Software Foundation; either version 2 of the License, or
6 ## (at your option) any later version.
7 ## 4 ##
8 ## This program is distributed in the hope that it will be useful, 5 ## Octave is free software; you can redistribute it and/or modify it
9 ## but WITHOUT ANY WARRANTY; without even the implied warranty of 6 ## under the terms of the GNU General Public License as published by
10 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 7 ## the Free Software Foundation; either version 2, or (at your option)
11 ## GNU General Public License for more details. 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.
12 ## 14 ##
13 ## You should have received a copy of the GNU General Public License 15 ## You should have received a copy of the GNU General Public License
14 ## along with this program; if not, write to the Free Software 16 ## along with Octave; see the file COPYING. If not, write to the Free
15 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 ## Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 ## 02110-1301, USA.
16 19
17 ## orient("landscape"|"portrait") 20 ## -*- texinfo -*-
18 ## Set default print orientation 21 ## @deftypefn {Function File} {} orient (@var{orientation})
19 ## 22 ## Set default print orientation. Valid values for @var{orientation}
20 ## ret = orient 23 ## include @code{"landscape"} and @code{"portrait"}. If called with no
21 ## Return default print orientation 24 ## arguments, return the default print orientation.
25 ## @end deftypefn
22 26
23 function ret = orient(orientation) 27 ## Author: Paul Kienzle
28 ## Adapted-By: jwe
24 29
25 static __print_orientation = "landscape"; 30 ## PKG_ADD: mark_as_command orient
31
32 function retval = orient (orientation)
33
34 static __print_orientation__ = "landscape";
26 35
27 if (nargin == 0) 36 if (nargin == 0)
28 ret = __print_orientation; 37 retval = __print_orientation__;
29
30 elseif (nargin == 1) 38 elseif (nargin == 1)
31 39 if (strcmp (orientation, "landscape") || strcmp (orientation, "portrait"))
32 if strcmp(orientation,"landscape") || strcmp(orientation,"portrait") 40 __print_orientation__ = orientation;
33 __print_orientation = orientation;
34 else 41 else
35 error ("orient: unknown orientation"); 42 error ("orient: unknown orientation");
36 endif 43 endif
37
38 else 44 else
39 45 usage("orient ([\"portrait\"|\"landscape\"]) OR ret = orient ()");
40 usage("orient(['portrait' | 'landscape']) OR ret=orient");
41
42 endif 46 endif
43 47
44 endfunction 48 endfunction
45 49
46 %!assert(orient,"landscape") # default 50 %!assert(orient,"landscape") # default