annotate scripts/plot/__axis_label__.m @ 6748:c7eb2c149528

[project @ 2007-06-20 17:44:35 by jwe]
author jwe
date Wed, 20 Jun 2007 17:44:35 +0000
parents 7888712d3532
children 76e3d985ae56
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3479
19e0f69da41e [project @ 2000-01-26 04:08:07 by jwe]
jwe
parents:
diff changeset
1 ## Copyright (C) 1996, 1997 John W. Eaton
19e0f69da41e [project @ 2000-01-26 04:08:07 by jwe]
jwe
parents:
diff changeset
2 ##
19e0f69da41e [project @ 2000-01-26 04:08:07 by jwe]
jwe
parents:
diff changeset
3 ## This file is part of Octave.
19e0f69da41e [project @ 2000-01-26 04:08:07 by jwe]
jwe
parents:
diff changeset
4 ##
19e0f69da41e [project @ 2000-01-26 04:08:07 by jwe]
jwe
parents:
diff changeset
5 ## Octave is free software; you can redistribute it and/or modify it
19e0f69da41e [project @ 2000-01-26 04:08:07 by jwe]
jwe
parents:
diff changeset
6 ## under the terms of the GNU General Public License as published by
19e0f69da41e [project @ 2000-01-26 04:08:07 by jwe]
jwe
parents:
diff changeset
7 ## the Free Software Foundation; either version 2, or (at your option)
19e0f69da41e [project @ 2000-01-26 04:08:07 by jwe]
jwe
parents:
diff changeset
8 ## any later version.
19e0f69da41e [project @ 2000-01-26 04:08:07 by jwe]
jwe
parents:
diff changeset
9 ##
19e0f69da41e [project @ 2000-01-26 04:08:07 by jwe]
jwe
parents:
diff changeset
10 ## Octave is distributed in the hope that it will be useful, but
19e0f69da41e [project @ 2000-01-26 04:08:07 by jwe]
jwe
parents:
diff changeset
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
19e0f69da41e [project @ 2000-01-26 04:08:07 by jwe]
jwe
parents:
diff changeset
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19e0f69da41e [project @ 2000-01-26 04:08:07 by jwe]
jwe
parents:
diff changeset
13 ## General Public License for more details.
19e0f69da41e [project @ 2000-01-26 04:08:07 by jwe]
jwe
parents:
diff changeset
14 ##
19e0f69da41e [project @ 2000-01-26 04:08:07 by jwe]
jwe
parents:
diff changeset
15 ## You should have received a copy of the GNU General Public License
19e0f69da41e [project @ 2000-01-26 04:08:07 by jwe]
jwe
parents:
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: 5253
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: 5253
diff changeset
18 ## 02110-1301, USA.
3479
19e0f69da41e [project @ 2000-01-26 04:08:07 by jwe]
jwe
parents:
diff changeset
19
19e0f69da41e [project @ 2000-01-26 04:08:07 by jwe]
jwe
parents:
diff changeset
20 ## -*- texinfo -*-
3497
1807b75711df [project @ 2000-01-30 03:44:55 by jwe]
jwe
parents: 3479
diff changeset
21 ## @deftypefn {Function File} {} __axis_label__ (@var{caller}, @var{text})
3479
19e0f69da41e [project @ 2000-01-26 04:08:07 by jwe]
jwe
parents:
diff changeset
22 ## Utility function for @code{xlabel}, @code{ylabel}, and @code{zlabel}.
19e0f69da41e [project @ 2000-01-26 04:08:07 by jwe]
jwe
parents:
diff changeset
23 ## @end deftypefn
19e0f69da41e [project @ 2000-01-26 04:08:07 by jwe]
jwe
parents:
diff changeset
24
19e0f69da41e [project @ 2000-01-26 04:08:07 by jwe]
jwe
parents:
diff changeset
25 ## Author: jwe
19e0f69da41e [project @ 2000-01-26 04:08:07 by jwe]
jwe
parents:
diff changeset
26
6412
b2096bb759b1 [project @ 2007-03-15 02:33:45 by jwe]
jwe
parents: 6405
diff changeset
27 function retval = __axis_label__ (caller, txt, varargin)
3479
19e0f69da41e [project @ 2000-01-26 04:08:07 by jwe]
jwe
parents:
diff changeset
28
6412
b2096bb759b1 [project @ 2007-03-15 02:33:45 by jwe]
jwe
parents: 6405
diff changeset
29 if (ischar (txt))
b2096bb759b1 [project @ 2007-03-15 02:33:45 by jwe]
jwe
parents: 6405
diff changeset
30 ## FIXME -- should be able to use text instead of __go_text__.
b2096bb759b1 [project @ 2007-03-15 02:33:45 by jwe]
jwe
parents: 6405
diff changeset
31 ca = gca ();
6737
7888712d3532 [project @ 2007-06-15 21:45:50 by jwe]
jwe
parents: 6412
diff changeset
32
7888712d3532 [project @ 2007-06-15 21:45:50 by jwe]
jwe
parents: 6412
diff changeset
33 if (strcmp (caller, "ylabel"))
7888712d3532 [project @ 2007-06-15 21:45:50 by jwe]
jwe
parents: 6412
diff changeset
34 rot = 90;
7888712d3532 [project @ 2007-06-15 21:45:50 by jwe]
jwe
parents: 6412
diff changeset
35 else
7888712d3532 [project @ 2007-06-15 21:45:50 by jwe]
jwe
parents: 6412
diff changeset
36 rot = 0;
7888712d3532 [project @ 2007-06-15 21:45:50 by jwe]
jwe
parents: 6412
diff changeset
37 endif
7888712d3532 [project @ 2007-06-15 21:45:50 by jwe]
jwe
parents: 6412
diff changeset
38
7888712d3532 [project @ 2007-06-15 21:45:50 by jwe]
jwe
parents: 6412
diff changeset
39 h = __go_text__ (ca, "string", txt, "rotation", rot, varargin{:});
6412
b2096bb759b1 [project @ 2007-03-15 02:33:45 by jwe]
jwe
parents: 6405
diff changeset
40 set (ca, caller, h);
b2096bb759b1 [project @ 2007-03-15 02:33:45 by jwe]
jwe
parents: 6405
diff changeset
41 if (nargout > 0)
b2096bb759b1 [project @ 2007-03-15 02:33:45 by jwe]
jwe
parents: 6405
diff changeset
42 retval = h;
3479
19e0f69da41e [project @ 2000-01-26 04:08:07 by jwe]
jwe
parents:
diff changeset
43 endif
19e0f69da41e [project @ 2000-01-26 04:08:07 by jwe]
jwe
parents:
diff changeset
44 else
6412
b2096bb759b1 [project @ 2007-03-15 02:33:45 by jwe]
jwe
parents: 6405
diff changeset
45 error ("%s: expecting first argument to be character string");
4529
78954aeaf321 [project @ 2003-10-04 19:35:36 by jwe]
jwe
parents: 3497
diff changeset
46 endif
78954aeaf321 [project @ 2003-10-04 19:35:36 by jwe]
jwe
parents: 3497
diff changeset
47
3479
19e0f69da41e [project @ 2000-01-26 04:08:07 by jwe]
jwe
parents:
diff changeset
48 endfunction