annotate scripts/plot/appearance/title.m @ 30564:796f54d4ddbf stable

update Octave Project Developers copyright for the new year In files that have the "Octave Project Developers" copyright notice, update for 2021. In all .txi and .texi files except gpl.txi and gpl.texi in the doc/liboctave and doc/interpreter directories, change the copyright to "Octave Project Developers", the same as used for other source files. Update copyright notices for 2022 (not done since 2019). For gpl.txi and gpl.texi, change the copyright notice to be "Free Software Foundation, Inc." and leave the date at 2007 only because this file only contains the text of the GPL, not anything created by the Octave Project Developers. Add Paul Thomas to contributors.in.
author John W. Eaton <jwe@octave.org>
date Tue, 28 Dec 2021 18:22:40 -0500
parents 0a5b15007766
children 597f3ee61a48
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
1 ########################################################################
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
2 ##
30564
796f54d4ddbf update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
3 ## Copyright (C) 1993-2022 The Octave Project Developers
27918
b442ec6dda5c use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents: 27898
diff changeset
4 ##
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
5 ## See the file COPYRIGHT.md in the top-level directory of this
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
6 ## distribution or <https://octave.org/copyright/>.
2313
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2311
diff changeset
7 ##
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2311
diff changeset
8 ## This file is part of Octave.
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2311
diff changeset
9 ##
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 24432
diff changeset
10 ## Octave is free software: you can redistribute it and/or modify it
2313
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2311
diff changeset
11 ## under the terms of the GNU General Public License as published by
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 24432
diff changeset
12 ## the Free Software Foundation, either version 3 of the License, or
22755
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22723
diff changeset
13 ## (at your option) any later version.
2313
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2311
diff changeset
14 ##
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2311
diff changeset
15 ## Octave is distributed in the hope that it will be useful, but
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2311
diff changeset
16 ## WITHOUT ANY WARRANTY; without even the implied warranty of
22755
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22723
diff changeset
17 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22723
diff changeset
18 ## GNU General Public License for more details.
2313
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2311
diff changeset
19 ##
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2311
diff changeset
20 ## 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: 6412
diff changeset
21 ## along with Octave; see the file COPYING. If not, see
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 24432
diff changeset
22 ## <https://www.gnu.org/licenses/>.
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
23 ##
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
24 ########################################################################
245
16a24e76d6e0 [project @ 1993-12-03 02:00:15 by jwe]
jwe
parents: 4
diff changeset
25
3368
a4cd1e9d9962 [project @ 1999-11-20 17:22:48 by jwe]
jwe
parents: 2847
diff changeset
26 ## -*- texinfo -*-
20852
516bb87ea72e 2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents: 19697
diff changeset
27 ## @deftypefn {} {} title (@var{string})
516bb87ea72e 2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents: 19697
diff changeset
28 ## @deftypefnx {} {} title (@var{string}, @var{prop}, @var{val}, @dots{})
516bb87ea72e 2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents: 19697
diff changeset
29 ## @deftypefnx {} {} title (@var{hax}, @dots{})
516bb87ea72e 2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents: 19697
diff changeset
30 ## @deftypefnx {} {@var{h} =} title (@dots{})
17048
3f99d7d22bd0 x(yz)label.m, title.m: Update to use new __plt_get_axis_arg__.
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 14363
diff changeset
31 ## Specify the string used as a title for the current axis.
3f99d7d22bd0 x(yz)label.m, title.m: Update to use new __plt_get_axis_arg__.
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 14363
diff changeset
32 ##
17122
eaab03308c0b doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents: 17048
diff changeset
33 ## An optional list of @var{property}/@var{value} pairs can be used to change
eaab03308c0b doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents: 17048
diff changeset
34 ## the appearance of the created title text object.
14001
5f0bb45e615c doc: Update documentation for functions returning a graphics handle h (Bug #34761)
Rik <octave@nomad.inbox5.com>
parents: 13812
diff changeset
35 ##
27786
188fb5415ab5 title.m: Allow a legend handle as first argument (bug #57372).
Rik <rik@octave.org>
parents: 26376
diff changeset
36 ## If the first argument @var{hax} is an axes or legend handle, then add a
188fb5415ab5 title.m: Allow a legend handle as first argument (bug #57372).
Rik <rik@octave.org>
parents: 26376
diff changeset
37 ## title to this object, rather than the current axes returned by @code{gca}.
17048
3f99d7d22bd0 x(yz)label.m, title.m: Update to use new __plt_get_axis_arg__.
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 14363
diff changeset
38 ##
3f99d7d22bd0 x(yz)label.m, title.m: Update to use new __plt_get_axis_arg__.
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 14363
diff changeset
39 ## The optional return value @var{h} is a graphics handle to the created text
3f99d7d22bd0 x(yz)label.m, title.m: Update to use new __plt_get_axis_arg__.
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 14363
diff changeset
40 ## object.
3f99d7d22bd0 x(yz)label.m, title.m: Update to use new __plt_get_axis_arg__.
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 14363
diff changeset
41 ## @seealso{xlabel, ylabel, zlabel, text}
3368
a4cd1e9d9962 [project @ 1999-11-20 17:22:48 by jwe]
jwe
parents: 2847
diff changeset
42 ## @end deftypefn
4
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
43
17048
3f99d7d22bd0 x(yz)label.m, title.m: Update to use new __plt_get_axis_arg__.
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 14363
diff changeset
44 function h = title (varargin)
3f99d7d22bd0 x(yz)label.m, title.m: Update to use new __plt_get_axis_arg__.
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 14363
diff changeset
45
3f99d7d22bd0 x(yz)label.m, title.m: Update to use new __plt_get_axis_arg__.
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 14363
diff changeset
46 [hax, varargin, nargin] = __plt_get_axis_arg__ ("title", varargin{:});
13800
5acb5c25e4ae allow axes handle to be passed to title function
John W. Eaton <jwe@octave.org>
parents: 13141
diff changeset
47
17048
3f99d7d22bd0 x(yz)label.m, title.m: Update to use new __plt_get_axis_arg__.
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 14363
diff changeset
48 if (isempty (hax))
27786
188fb5415ab5 title.m: Allow a legend handle as first argument (bug #57372).
Rik <rik@octave.org>
parents: 26376
diff changeset
49 if (! isempty (varargin) && isscalar (varargin{1})
188fb5415ab5 title.m: Allow a legend handle as first argument (bug #57372).
Rik <rik@octave.org>
parents: 26376
diff changeset
50 && ishghandle (varargin{1})
188fb5415ab5 title.m: Allow a legend handle as first argument (bug #57372).
Rik <rik@octave.org>
parents: 26376
diff changeset
51 && strcmp (get (varargin{1}, "tag"), "legend"))
188fb5415ab5 title.m: Allow a legend handle as first argument (bug #57372).
Rik <rik@octave.org>
parents: 26376
diff changeset
52 hax = varargin{1};
188fb5415ab5 title.m: Allow a legend handle as first argument (bug #57372).
Rik <rik@octave.org>
parents: 26376
diff changeset
53 varargin(1) = [];
188fb5415ab5 title.m: Allow a legend handle as first argument (bug #57372).
Rik <rik@octave.org>
parents: 26376
diff changeset
54 nargin--;
188fb5415ab5 title.m: Allow a legend handle as first argument (bug #57372).
Rik <rik@octave.org>
parents: 26376
diff changeset
55 else
188fb5415ab5 title.m: Allow a legend handle as first argument (bug #57372).
Rik <rik@octave.org>
parents: 26376
diff changeset
56 hax = gca ();
188fb5415ab5 title.m: Allow a legend handle as first argument (bug #57372).
Rik <rik@octave.org>
parents: 26376
diff changeset
57 endif
17048
3f99d7d22bd0 x(yz)label.m, title.m: Update to use new __plt_get_axis_arg__.
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 14363
diff changeset
58 endif
19593
446c46af4b42 strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents: 17744
diff changeset
59
13800
5acb5c25e4ae allow axes handle to be passed to title function
John W. Eaton <jwe@octave.org>
parents: 13141
diff changeset
60 if (rem (nargin, 2) != 1)
6046
34f96dd5441b [project @ 2006-10-10 16:10:25 by jwe]
jwe
parents: 5775
diff changeset
61 print_usage ();
4
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
62 endif
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
63
22925
509b2ef72225 Properly initialize axes labels font properties (bug #49775)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 22755
diff changeset
64 htmp = __axis_label__ (hax, "title", varargin{:});
13800
5acb5c25e4ae allow axes handle to be passed to title function
John W. Eaton <jwe@octave.org>
parents: 13141
diff changeset
65
5acb5c25e4ae allow axes handle to be passed to title function
John W. Eaton <jwe@octave.org>
parents: 13141
diff changeset
66 if (nargout > 0)
17048
3f99d7d22bd0 x(yz)label.m, title.m: Update to use new __plt_get_axis_arg__.
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 14363
diff changeset
67 h = htmp;
13800
5acb5c25e4ae allow axes handle to be passed to title function
John W. Eaton <jwe@octave.org>
parents: 13141
diff changeset
68 endif
5acb5c25e4ae allow axes handle to be passed to title function
John W. Eaton <jwe@octave.org>
parents: 13141
diff changeset
69
4
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
70 endfunction
13089
87015276d625 codesprint: demos for title
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
71
14001
5f0bb45e615c doc: Update documentation for functions returning a graphics handle h (Bug #34761)
Rik <octave@nomad.inbox5.com>
parents: 13812
diff changeset
72
13089
87015276d625 codesprint: demos for title
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
73 %!demo
14237
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
74 %! clf;
22292
378f8c0de848 Implement TitleFontSizeMultiplier, LabelFontSizeMultiplier, TitleFontWeight props.
Rik <rik@octave.org>
parents: 20852
diff changeset
75 %! title ("Test Title Text");
17190
df4c4b7708a4 Add titles and clean-up plotting %!demos.
Rik <rik@octave.org>
parents: 17122
diff changeset
76
df4c4b7708a4 Add titles and clean-up plotting %!demos.
Rik <rik@octave.org>
parents: 17122
diff changeset
77 %!demo
df4c4b7708a4 Add titles and clean-up plotting %!demos.
Rik <rik@octave.org>
parents: 17122
diff changeset
78 %! clf;
22292
378f8c0de848 Implement TitleFontSizeMultiplier, LabelFontSizeMultiplier, TitleFontWeight props.
Rik <rik@octave.org>
parents: 20852
diff changeset
79 %! title ({"Multi-line"; "Title"; "Text"});
13089
87015276d625 codesprint: demos for title
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
80
87015276d625 codesprint: demos for title
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
81 %!demo
14237
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
82 %! clf;
13089
87015276d625 codesprint: demos for title
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
83 %! plot3 ([0,1], [0,1], [0,1]);
22292
378f8c0de848 Implement TitleFontSizeMultiplier, LabelFontSizeMultiplier, TitleFontWeight props.
Rik <rik@octave.org>
parents: 20852
diff changeset
84 %! title ("Test FontSize Property", "fontsize", 16);
13089
87015276d625 codesprint: demos for title
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
85
13136
79b9a7669bb8 Tests added for scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 13089
diff changeset
86 %!test
79b9a7669bb8 Tests added for scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 13089
diff changeset
87 %! hf = figure ("visible", "off");
13141
e81ddf9cacd5 maint: untabify and remove trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 13136
diff changeset
88 %! unwind_protect
17190
df4c4b7708a4 Add titles and clean-up plotting %!demos.
Rik <rik@octave.org>
parents: 17122
diff changeset
89 %! title ("Test Title Text");
22292
378f8c0de848 Implement TitleFontSizeMultiplier, LabelFontSizeMultiplier, TitleFontWeight props.
Rik <rik@octave.org>
parents: 20852
diff changeset
90 %! h = get (gca, "title");
17190
df4c4b7708a4 Add titles and clean-up plotting %!demos.
Rik <rik@octave.org>
parents: 17122
diff changeset
91 %! assert (get (h, "string"), "Test Title Text");
df4c4b7708a4 Add titles and clean-up plotting %!demos.
Rik <rik@octave.org>
parents: 17122
diff changeset
92 %! unwind_protect_cleanup
df4c4b7708a4 Add titles and clean-up plotting %!demos.
Rik <rik@octave.org>
parents: 17122
diff changeset
93 %! close (hf);
df4c4b7708a4 Add titles and clean-up plotting %!demos.
Rik <rik@octave.org>
parents: 17122
diff changeset
94 %! end_unwind_protect
df4c4b7708a4 Add titles and clean-up plotting %!demos.
Rik <rik@octave.org>
parents: 17122
diff changeset
95
df4c4b7708a4 Add titles and clean-up plotting %!demos.
Rik <rik@octave.org>
parents: 17122
diff changeset
96 %!test
df4c4b7708a4 Add titles and clean-up plotting %!demos.
Rik <rik@octave.org>
parents: 17122
diff changeset
97 %! hf = figure ("visible", "off");
df4c4b7708a4 Add titles and clean-up plotting %!demos.
Rik <rik@octave.org>
parents: 17122
diff changeset
98 %! unwind_protect
22292
378f8c0de848 Implement TitleFontSizeMultiplier, LabelFontSizeMultiplier, TitleFontWeight props.
Rik <rik@octave.org>
parents: 20852
diff changeset
99 %! title ({"Multi-line"; "Title"; "Text"});
378f8c0de848 Implement TitleFontSizeMultiplier, LabelFontSizeMultiplier, TitleFontWeight props.
Rik <rik@octave.org>
parents: 20852
diff changeset
100 %! h = get (gca, "title");
378f8c0de848 Implement TitleFontSizeMultiplier, LabelFontSizeMultiplier, TitleFontWeight props.
Rik <rik@octave.org>
parents: 20852
diff changeset
101 %! assert (get (h, "string"), {"Multi-line"; "Title"; "Text"});
378f8c0de848 Implement TitleFontSizeMultiplier, LabelFontSizeMultiplier, TitleFontWeight props.
Rik <rik@octave.org>
parents: 20852
diff changeset
102 %! unwind_protect_cleanup
378f8c0de848 Implement TitleFontSizeMultiplier, LabelFontSizeMultiplier, TitleFontWeight props.
Rik <rik@octave.org>
parents: 20852
diff changeset
103 %! close (hf);
378f8c0de848 Implement TitleFontSizeMultiplier, LabelFontSizeMultiplier, TitleFontWeight props.
Rik <rik@octave.org>
parents: 20852
diff changeset
104 %! end_unwind_protect
378f8c0de848 Implement TitleFontSizeMultiplier, LabelFontSizeMultiplier, TitleFontWeight props.
Rik <rik@octave.org>
parents: 20852
diff changeset
105
378f8c0de848 Implement TitleFontSizeMultiplier, LabelFontSizeMultiplier, TitleFontWeight props.
Rik <rik@octave.org>
parents: 20852
diff changeset
106 %!test
378f8c0de848 Implement TitleFontSizeMultiplier, LabelFontSizeMultiplier, TitleFontWeight props.
Rik <rik@octave.org>
parents: 20852
diff changeset
107 %! hf = figure ("visible", "off");
378f8c0de848 Implement TitleFontSizeMultiplier, LabelFontSizeMultiplier, TitleFontWeight props.
Rik <rik@octave.org>
parents: 20852
diff changeset
108 %! unwind_protect
378f8c0de848 Implement TitleFontSizeMultiplier, LabelFontSizeMultiplier, TitleFontWeight props.
Rik <rik@octave.org>
parents: 20852
diff changeset
109 %! set (gca, "fontsize", 5, "titlefontsizemultiplier", 3);
378f8c0de848 Implement TitleFontSizeMultiplier, LabelFontSizeMultiplier, TitleFontWeight props.
Rik <rik@octave.org>
parents: 20852
diff changeset
110 %! ht = title ("title_string", "color", "r");
378f8c0de848 Implement TitleFontSizeMultiplier, LabelFontSizeMultiplier, TitleFontWeight props.
Rik <rik@octave.org>
parents: 20852
diff changeset
111 %! assert (get (ht, "fontsize"), 15);
378f8c0de848 Implement TitleFontSizeMultiplier, LabelFontSizeMultiplier, TitleFontWeight props.
Rik <rik@octave.org>
parents: 20852
diff changeset
112 %! assert (get (ht, "color"), [1 0 0]);
13136
79b9a7669bb8 Tests added for scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 13089
diff changeset
113 %! unwind_protect_cleanup
79b9a7669bb8 Tests added for scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 13089
diff changeset
114 %! close (hf);
79b9a7669bb8 Tests added for scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 13089
diff changeset
115 %! end_unwind_protect
79b9a7669bb8 Tests added for scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 13089
diff changeset
116
79b9a7669bb8 Tests added for scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 13089
diff changeset
117 %!test
79b9a7669bb8 Tests added for scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 13089
diff changeset
118 %! hf = figure ("visible", "off");
13141
e81ddf9cacd5 maint: untabify and remove trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 13136
diff changeset
119 %! unwind_protect
13136
79b9a7669bb8 Tests added for scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 13089
diff changeset
120 %! plot3 ([0,1], [0,1], [0,1]);
22292
378f8c0de848 Implement TitleFontSizeMultiplier, LabelFontSizeMultiplier, TitleFontWeight props.
Rik <rik@octave.org>
parents: 20852
diff changeset
121 %! title ("Test FontSize Property", "fontsize", 16);
17048
3f99d7d22bd0 x(yz)label.m, title.m: Update to use new __plt_get_axis_arg__.
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 14363
diff changeset
122 %! h = get (gca, "title");
17190
df4c4b7708a4 Add titles and clean-up plotting %!demos.
Rik <rik@octave.org>
parents: 17122
diff changeset
123 %! assert (get (h, "string"), "Test FontSize Property");
df4c4b7708a4 Add titles and clean-up plotting %!demos.
Rik <rik@octave.org>
parents: 17122
diff changeset
124 %! assert (get (h, "fontsize"), 16);
13136
79b9a7669bb8 Tests added for scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 13089
diff changeset
125 %! unwind_protect_cleanup
79b9a7669bb8 Tests added for scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 13089
diff changeset
126 %! close (hf);
79b9a7669bb8 Tests added for scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 13089
diff changeset
127 %! end_unwind_protect
14001
5f0bb45e615c doc: Update documentation for functions returning a graphics handle h (Bug #34761)
Rik <octave@nomad.inbox5.com>
parents: 13812
diff changeset
128
23573
1b4f4ec53b4a use new script to tag fixed bugs in tests
John W. Eaton <jwe@octave.org>
parents: 23572
diff changeset
129 %!test <*49469>
22723
03cebe1fb0e3 Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 22323
diff changeset
130 %! hf = figure ("visible", "off");
03cebe1fb0e3 Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 22323
diff changeset
131 %! unwind_protect
03cebe1fb0e3 Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 22323
diff changeset
132 %! ht = title ("Test FontSize Property");
03cebe1fb0e3 Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 22323
diff changeset
133 %! set (gca, "fontname", "Liberation Serif")
03cebe1fb0e3 Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 22323
diff changeset
134 %! set (gca, "fontsize", 13)
03cebe1fb0e3 Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 22323
diff changeset
135 %! assert (get (ht, "fontname"), "Liberation Serif");
03cebe1fb0e3 Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 22323
diff changeset
136 %! assert (get (ht, "fontsize"), 13 * get (gca, "titlefontsizemultiplier"));
03cebe1fb0e3 Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 22323
diff changeset
137 %! unwind_protect_cleanup
03cebe1fb0e3 Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 22323
diff changeset
138 %! close (hf);
03cebe1fb0e3 Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 22323
diff changeset
139 %! end_unwind_protect
27786
188fb5415ab5 title.m: Allow a legend handle as first argument (bug #57372).
Rik <rik@octave.org>
parents: 26376
diff changeset
140
188fb5415ab5 title.m: Allow a legend handle as first argument (bug #57372).
Rik <rik@octave.org>
parents: 26376
diff changeset
141 %!test <*57372>
188fb5415ab5 title.m: Allow a legend handle as first argument (bug #57372).
Rik <rik@octave.org>
parents: 26376
diff changeset
142 %! hf = figure ("visible", "off");
188fb5415ab5 title.m: Allow a legend handle as first argument (bug #57372).
Rik <rik@octave.org>
parents: 26376
diff changeset
143 %! unwind_protect
188fb5415ab5 title.m: Allow a legend handle as first argument (bug #57372).
Rik <rik@octave.org>
parents: 26376
diff changeset
144 %! plot (1:10);
188fb5415ab5 title.m: Allow a legend handle as first argument (bug #57372).
Rik <rik@octave.org>
parents: 26376
diff changeset
145 %! hl = legend ("legend text");
188fb5415ab5 title.m: Allow a legend handle as first argument (bug #57372).
Rik <rik@octave.org>
parents: 26376
diff changeset
146 %! ht = title (hl, "Legend Title");
188fb5415ab5 title.m: Allow a legend handle as first argument (bug #57372).
Rik <rik@octave.org>
parents: 26376
diff changeset
147 %! assert (get (ht, "string"), "Legend Title");
188fb5415ab5 title.m: Allow a legend handle as first argument (bug #57372).
Rik <rik@octave.org>
parents: 26376
diff changeset
148 %! assert (get (ht, "parent"), hl);
188fb5415ab5 title.m: Allow a legend handle as first argument (bug #57372).
Rik <rik@octave.org>
parents: 26376
diff changeset
149 %! unwind_protect_cleanup
188fb5415ab5 title.m: Allow a legend handle as first argument (bug #57372).
Rik <rik@octave.org>
parents: 26376
diff changeset
150 %! close (hf);
188fb5415ab5 title.m: Allow a legend handle as first argument (bug #57372).
Rik <rik@octave.org>
parents: 26376
diff changeset
151 %! end_unwind_protect