Mercurial > octave-nkf
annotate scripts/plot/__axis_label__.m @ 8557:ab82e19002c4
better compatibility for axis label properties
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 21 Jan 2009 14:30:41 -0500 |
parents | d81caf2e3a28 |
children | 7d48766c21a5 |
rev | line source |
---|---|
7017 | 1 ## Copyright (C) 1996, 1997, 2000, 2003, 2005, 2006, 2007 John W. Eaton |
3479 | 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 | |
7016 | 7 ## the Free Software Foundation; either version 3 of the License, or (at |
8 ## your option) any later version. | |
3479 | 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. | |
14 ## | |
15 ## You should have received a copy of the GNU General Public License | |
7016 | 16 ## along with Octave; see the file COPYING. If not, see |
17 ## <http://www.gnu.org/licenses/>. | |
3479 | 18 |
6895 | 19 ## Undocumented internal function. |
3479 | 20 |
21 ## Author: jwe | |
22 | |
6412 | 23 function retval = __axis_label__ (caller, txt, varargin) |
3479 | 24 |
6412 | 25 if (ischar (txt)) |
26 ca = gca (); | |
6737 | 27 |
8557
ab82e19002c4
better compatibility for axis label properties
John W. Eaton <jwe@octave.org>
parents:
8556
diff
changeset
|
28 h = get (gca (), caller); |
ab82e19002c4
better compatibility for axis label properties
John W. Eaton <jwe@octave.org>
parents:
8556
diff
changeset
|
29 |
ab82e19002c4
better compatibility for axis label properties
John W. Eaton <jwe@octave.org>
parents:
8556
diff
changeset
|
30 set (h, "fontangle", get (ca, "fontangle"), |
ab82e19002c4
better compatibility for axis label properties
John W. Eaton <jwe@octave.org>
parents:
8556
diff
changeset
|
31 "fontname", get (ca, "fontname"), |
ab82e19002c4
better compatibility for axis label properties
John W. Eaton <jwe@octave.org>
parents:
8556
diff
changeset
|
32 "fontsize", get (ca, "fontsize"), |
ab82e19002c4
better compatibility for axis label properties
John W. Eaton <jwe@octave.org>
parents:
8556
diff
changeset
|
33 "fontunits", get (ca, "fontunits"), |
ab82e19002c4
better compatibility for axis label properties
John W. Eaton <jwe@octave.org>
parents:
8556
diff
changeset
|
34 "fontweight", get (ca, "fontweight"), |
ab82e19002c4
better compatibility for axis label properties
John W. Eaton <jwe@octave.org>
parents:
8556
diff
changeset
|
35 "string", txt, |
ab82e19002c4
better compatibility for axis label properties
John W. Eaton <jwe@octave.org>
parents:
8556
diff
changeset
|
36 varargin{:}); |
ab82e19002c4
better compatibility for axis label properties
John W. Eaton <jwe@octave.org>
parents:
8556
diff
changeset
|
37 |
6412 | 38 if (nargout > 0) |
39 retval = h; | |
3479 | 40 endif |
41 else | |
7654
48edf48cd4dc
__axis_label__: use name of caller in error message
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
42 error ("%s: expecting first argument to be character string", caller); |
4529 | 43 endif |
44 | |
3479 | 45 endfunction |