Mercurial > octave
annotate scripts/plot/util/groot.m @ 29359:7854d5752dd2
maint: merge stable to default.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 10 Feb 2021 10:10:40 -0500 |
parents | d8318c12d903 0a5b15007766 |
children | 796f54d4ddbf |
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 ## |
29358
0a5b15007766
update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
3 ## Copyright (C) 2017-2021 The Octave Project Developers |
27918
b442ec6dda5c
use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents:
26376
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/>. |
24462
8ff3c13d14c1
groot.m: New function to return handle of graphics root object.
Rik <rik@octave.org>
parents:
diff
changeset
|
7 ## |
8ff3c13d14c1
groot.m: New function to return handle of graphics root object.
Rik <rik@octave.org>
parents:
diff
changeset
|
8 ## This file is part of Octave. |
8ff3c13d14c1
groot.m: New function to return handle of graphics root object.
Rik <rik@octave.org>
parents:
diff
changeset
|
9 ## |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
24462
diff
changeset
|
10 ## Octave is free software: you can redistribute it and/or modify it |
24462
8ff3c13d14c1
groot.m: New function to return handle of graphics root object.
Rik <rik@octave.org>
parents:
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:
24462
diff
changeset
|
12 ## the Free Software Foundation, either version 3 of the License, or |
24462
8ff3c13d14c1
groot.m: New function to return handle of graphics root object.
Rik <rik@octave.org>
parents:
diff
changeset
|
13 ## (at your option) any later version. |
8ff3c13d14c1
groot.m: New function to return handle of graphics root object.
Rik <rik@octave.org>
parents:
diff
changeset
|
14 ## |
8ff3c13d14c1
groot.m: New function to return handle of graphics root object.
Rik <rik@octave.org>
parents:
diff
changeset
|
15 ## Octave is distributed in the hope that it will be useful, but |
8ff3c13d14c1
groot.m: New function to return handle of graphics root object.
Rik <rik@octave.org>
parents:
diff
changeset
|
16 ## WITHOUT ANY WARRANTY; without even the implied warranty of |
8ff3c13d14c1
groot.m: New function to return handle of graphics root object.
Rik <rik@octave.org>
parents:
diff
changeset
|
17 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
8ff3c13d14c1
groot.m: New function to return handle of graphics root object.
Rik <rik@octave.org>
parents:
diff
changeset
|
18 ## GNU General Public License for more details. |
8ff3c13d14c1
groot.m: New function to return handle of graphics root object.
Rik <rik@octave.org>
parents:
diff
changeset
|
19 ## |
8ff3c13d14c1
groot.m: New function to return handle of graphics root object.
Rik <rik@octave.org>
parents:
diff
changeset
|
20 ## You should have received a copy of the GNU General Public License |
8ff3c13d14c1
groot.m: New function to return handle of graphics root object.
Rik <rik@octave.org>
parents:
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:
24462
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 ######################################################################## |
24462
8ff3c13d14c1
groot.m: New function to return handle of graphics root object.
Rik <rik@octave.org>
parents:
diff
changeset
|
25 |
8ff3c13d14c1
groot.m: New function to return handle of graphics root object.
Rik <rik@octave.org>
parents:
diff
changeset
|
26 ## -*- texinfo -*- |
8ff3c13d14c1
groot.m: New function to return handle of graphics root object.
Rik <rik@octave.org>
parents:
diff
changeset
|
27 ## @deftypefn {} {@var{h} =} groot () |
8ff3c13d14c1
groot.m: New function to return handle of graphics root object.
Rik <rik@octave.org>
parents:
diff
changeset
|
28 ## Return a handle to the root graphics object. |
8ff3c13d14c1
groot.m: New function to return handle of graphics root object.
Rik <rik@octave.org>
parents:
diff
changeset
|
29 ## |
8ff3c13d14c1
groot.m: New function to return handle of graphics root object.
Rik <rik@octave.org>
parents:
diff
changeset
|
30 ## The root graphics object is the ultimate parent of all graphics objects. |
8ff3c13d14c1
groot.m: New function to return handle of graphics root object.
Rik <rik@octave.org>
parents:
diff
changeset
|
31 ## |
8ff3c13d14c1
groot.m: New function to return handle of graphics root object.
Rik <rik@octave.org>
parents:
diff
changeset
|
32 ## In addition, the root object contains information about the graphics |
8ff3c13d14c1
groot.m: New function to return handle of graphics root object.
Rik <rik@octave.org>
parents:
diff
changeset
|
33 ## system as a whole such as the @code{ScreenSize}. Use @w{@code{get (groot)}} |
8ff3c13d14c1
groot.m: New function to return handle of graphics root object.
Rik <rik@octave.org>
parents:
diff
changeset
|
34 ## to find out what information is available. |
8ff3c13d14c1
groot.m: New function to return handle of graphics root object.
Rik <rik@octave.org>
parents:
diff
changeset
|
35 ## |
8ff3c13d14c1
groot.m: New function to return handle of graphics root object.
Rik <rik@octave.org>
parents:
diff
changeset
|
36 ## Defaults for the graphic system as a whole are specified by setting |
8ff3c13d14c1
groot.m: New function to return handle of graphics root object.
Rik <rik@octave.org>
parents:
diff
changeset
|
37 ## properties of the root graphics object that begin with @qcode{"Default"}. |
8ff3c13d14c1
groot.m: New function to return handle of graphics root object.
Rik <rik@octave.org>
parents:
diff
changeset
|
38 ## For example, to set the default font for all text objects to FreeSans use |
8ff3c13d14c1
groot.m: New function to return handle of graphics root object.
Rik <rik@octave.org>
parents:
diff
changeset
|
39 ## |
8ff3c13d14c1
groot.m: New function to return handle of graphics root object.
Rik <rik@octave.org>
parents:
diff
changeset
|
40 ## @example |
8ff3c13d14c1
groot.m: New function to return handle of graphics root object.
Rik <rik@octave.org>
parents:
diff
changeset
|
41 ## set (groot, "DefaultTextFontName", "FreeSans") |
8ff3c13d14c1
groot.m: New function to return handle of graphics root object.
Rik <rik@octave.org>
parents:
diff
changeset
|
42 ## @end example |
8ff3c13d14c1
groot.m: New function to return handle of graphics root object.
Rik <rik@octave.org>
parents:
diff
changeset
|
43 ## |
8ff3c13d14c1
groot.m: New function to return handle of graphics root object.
Rik <rik@octave.org>
parents:
diff
changeset
|
44 ## Default properties can be deleted by using @code{set} with the special |
8ff3c13d14c1
groot.m: New function to return handle of graphics root object.
Rik <rik@octave.org>
parents:
diff
changeset
|
45 ## property value of @qcode{"remove"}. To undo the default font assignment |
8ff3c13d14c1
groot.m: New function to return handle of graphics root object.
Rik <rik@octave.org>
parents:
diff
changeset
|
46 ## above use |
8ff3c13d14c1
groot.m: New function to return handle of graphics root object.
Rik <rik@octave.org>
parents:
diff
changeset
|
47 ## |
8ff3c13d14c1
groot.m: New function to return handle of graphics root object.
Rik <rik@octave.org>
parents:
diff
changeset
|
48 ## @example |
8ff3c13d14c1
groot.m: New function to return handle of graphics root object.
Rik <rik@octave.org>
parents:
diff
changeset
|
49 ## set (groot, "DefaultTextFontName", "remove") |
8ff3c13d14c1
groot.m: New function to return handle of graphics root object.
Rik <rik@octave.org>
parents:
diff
changeset
|
50 ## @end example |
8ff3c13d14c1
groot.m: New function to return handle of graphics root object.
Rik <rik@octave.org>
parents:
diff
changeset
|
51 ## |
8ff3c13d14c1
groot.m: New function to return handle of graphics root object.
Rik <rik@octave.org>
parents:
diff
changeset
|
52 ## Programming Note: The root graphics object is identified by the special |
8ff3c13d14c1
groot.m: New function to return handle of graphics root object.
Rik <rik@octave.org>
parents:
diff
changeset
|
53 ## handle value of 0. At some point this unique value may change, but code can |
8ff3c13d14c1
groot.m: New function to return handle of graphics root object.
Rik <rik@octave.org>
parents:
diff
changeset
|
54 ## be made resistant to future changes by using @code{groot} which is |
8ff3c13d14c1
groot.m: New function to return handle of graphics root object.
Rik <rik@octave.org>
parents:
diff
changeset
|
55 ## guaranteed to always return the root graphics object. |
8ff3c13d14c1
groot.m: New function to return handle of graphics root object.
Rik <rik@octave.org>
parents:
diff
changeset
|
56 ## @seealso{gcf, gca, get, set} |
8ff3c13d14c1
groot.m: New function to return handle of graphics root object.
Rik <rik@octave.org>
parents:
diff
changeset
|
57 ## @end deftypefn |
8ff3c13d14c1
groot.m: New function to return handle of graphics root object.
Rik <rik@octave.org>
parents:
diff
changeset
|
58 |
8ff3c13d14c1
groot.m: New function to return handle of graphics root object.
Rik <rik@octave.org>
parents:
diff
changeset
|
59 function h = groot () |
8ff3c13d14c1
groot.m: New function to return handle of graphics root object.
Rik <rik@octave.org>
parents:
diff
changeset
|
60 |
8ff3c13d14c1
groot.m: New function to return handle of graphics root object.
Rik <rik@octave.org>
parents:
diff
changeset
|
61 h = 0; |
8ff3c13d14c1
groot.m: New function to return handle of graphics root object.
Rik <rik@octave.org>
parents:
diff
changeset
|
62 |
8ff3c13d14c1
groot.m: New function to return handle of graphics root object.
Rik <rik@octave.org>
parents:
diff
changeset
|
63 endfunction |
8ff3c13d14c1
groot.m: New function to return handle of graphics root object.
Rik <rik@octave.org>
parents:
diff
changeset
|
64 |
8ff3c13d14c1
groot.m: New function to return handle of graphics root object.
Rik <rik@octave.org>
parents:
diff
changeset
|
65 |
8ff3c13d14c1
groot.m: New function to return handle of graphics root object.
Rik <rik@octave.org>
parents:
diff
changeset
|
66 %!assert (groot (), 0) |