annotate scripts/plot/private/__axis_label__.m @ 12965:22bc9ec80c2c

allow multi-line string property for text objects using cell arrays or char matrices * __axis_label__.m: Don't check type of txt argument. * __go_draw_axes__.m: Handle multi-line string property for text objects. * text.m: Likewise. * gl2ps-renderer.cc (glps_renderer::draw_text): Handle text::properties string property as octave_value object that can contain either a char array or cellstr object. * graphics.cc (axes::properties::update_xlabel_position, axes::properties::update_ylabel_position, axes::properties::update_zlabel_position, axes::properties::get_extent, text::properties::update_text_extent): Likewise. * graphics.h.in (text_label_property::do_set): Don't forget to set stored_type when value is a cell. (text::properties::get_string): Delete custom getter.
author Ben Abbott <bpabbott@mac.com>
date Mon, 15 Aug 2011 10:24:09 -0400
parents e7c8ce0c0d3e
children 5acb5c25e4ae
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
1 ## Copyright (C) 1996-2011 John W. Eaton
3479
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
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6895
diff changeset
7 ## the Free Software Foundation; either version 3 of the License, or (at
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6895
diff changeset
8 ## your option) any later version.
3479
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
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6895
diff changeset
16 ## along with Octave; see the file COPYING. If not, see
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6895
diff changeset
17 ## <http://www.gnu.org/licenses/>.
3479
19e0f69da41e [project @ 2000-01-26 04:08:07 by jwe]
jwe
parents:
diff changeset
18
8812
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8557
diff changeset
19 ## -*- texinfo -*-
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8557
diff changeset
20 ## @deftypefn {Function File} {} __axis_label__ (@var{caller}, @var{txt}, @dots{})
6895
76e3d985ae56 [project @ 2007-09-13 18:22:38 by jwe]
jwe
parents: 6737
diff changeset
21 ## Undocumented internal function.
8812
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8557
diff changeset
22 ## @end deftypefn
3479
19e0f69da41e [project @ 2000-01-26 04:08:07 by jwe]
jwe
parents:
diff changeset
23
19e0f69da41e [project @ 2000-01-26 04:08:07 by jwe]
jwe
parents:
diff changeset
24 ## Author: jwe
19e0f69da41e [project @ 2000-01-26 04:08:07 by jwe]
jwe
parents:
diff changeset
25
6412
b2096bb759b1 [project @ 2007-03-15 02:33:45 by jwe]
jwe
parents: 6405
diff changeset
26 function retval = __axis_label__ (caller, txt, varargin)
3479
19e0f69da41e [project @ 2000-01-26 04:08:07 by jwe]
jwe
parents:
diff changeset
27
12965
22bc9ec80c2c allow multi-line string property for text objects using cell arrays or char matrices
Ben Abbott <bpabbott@mac.com>
parents: 12319
diff changeset
28 ca = gca ();
6737
7888712d3532 [project @ 2007-06-15 21:45:50 by jwe]
jwe
parents: 6412
diff changeset
29
12965
22bc9ec80c2c allow multi-line string property for text objects using cell arrays or char matrices
Ben Abbott <bpabbott@mac.com>
parents: 12319
diff changeset
30 h = get (gca (), caller);
8557
ab82e19002c4 better compatibility for axis label properties
John W. Eaton <jwe@octave.org>
parents: 8556
diff changeset
31
12965
22bc9ec80c2c allow multi-line string property for text objects using cell arrays or char matrices
Ben Abbott <bpabbott@mac.com>
parents: 12319
diff changeset
32 set (h, "fontangle", get (ca, "fontangle"),
22bc9ec80c2c allow multi-line string property for text objects using cell arrays or char matrices
Ben Abbott <bpabbott@mac.com>
parents: 12319
diff changeset
33 "fontname", get (ca, "fontname"),
22bc9ec80c2c allow multi-line string property for text objects using cell arrays or char matrices
Ben Abbott <bpabbott@mac.com>
parents: 12319
diff changeset
34 "fontsize", get (ca, "fontsize"),
22bc9ec80c2c allow multi-line string property for text objects using cell arrays or char matrices
Ben Abbott <bpabbott@mac.com>
parents: 12319
diff changeset
35 "fontunits", get (ca, "fontunits"),
22bc9ec80c2c allow multi-line string property for text objects using cell arrays or char matrices
Ben Abbott <bpabbott@mac.com>
parents: 12319
diff changeset
36 "fontweight", get (ca, "fontweight"),
22bc9ec80c2c allow multi-line string property for text objects using cell arrays or char matrices
Ben Abbott <bpabbott@mac.com>
parents: 12319
diff changeset
37 "string", txt,
22bc9ec80c2c allow multi-line string property for text objects using cell arrays or char matrices
Ben Abbott <bpabbott@mac.com>
parents: 12319
diff changeset
38 varargin{:});
11589
b0084095098e missing semicolons in script files
John W. Eaton <jwe@octave.org>
parents: 11587
diff changeset
39
12965
22bc9ec80c2c allow multi-line string property for text objects using cell arrays or char matrices
Ben Abbott <bpabbott@mac.com>
parents: 12319
diff changeset
40 if (nargout > 0)
22bc9ec80c2c allow multi-line string property for text objects using cell arrays or char matrices
Ben Abbott <bpabbott@mac.com>
parents: 12319
diff changeset
41 retval = h;
4529
78954aeaf321 [project @ 2003-10-04 19:35:36 by jwe]
jwe
parents: 3497
diff changeset
42 endif
78954aeaf321 [project @ 2003-10-04 19:35:36 by jwe]
jwe
parents: 3497
diff changeset
43
3479
19e0f69da41e [project @ 2000-01-26 04:08:07 by jwe]
jwe
parents:
diff changeset
44 endfunction