Mercurial > hg > octave-lyh
annotate scripts/plot/gca.m @ 17194:c954b0a396a2
comet.m: Speed up animation by using low-level graphic commands.
* scripts/plot/comet.m: Speed up animation by using low-level graphic
commands.
author | Rik <rik@octave.org> |
---|---|
date | Mon, 05 Aug 2013 15:44:02 -0700 |
parents | eaab03308c0b |
children | 4f1d827e1302 |
rev | line source |
---|---|
14138
72c96de7a403
maint: update copyright notices for 2012
John W. Eaton <jwe@octave.org>
parents:
13141
diff
changeset
|
1 ## Copyright (C) 2005-2012 John W. Eaton |
6257 | 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. | |
6257 | 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/>. | |
6257 | 18 |
19 ## -*- texinfo -*- | |
16814
64e7bb01fce2
doc: Improve documentation for 2-D plot functions
Rik <rik@octave.org>
parents:
14363
diff
changeset
|
20 ## @deftypefn {Function File} {@var{h} =} gca () |
17126
eaab03308c0b
doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents:
16814
diff
changeset
|
21 ## Return a handle to the current axis object. |
eaab03308c0b
doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents:
16814
diff
changeset
|
22 ## |
eaab03308c0b
doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents:
16814
diff
changeset
|
23 ## If no axis object exists, create one and return its handle. The handle may |
eaab03308c0b
doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents:
16814
diff
changeset
|
24 ## then be used to examine or set properties of the axes. For example, |
6895 | 25 ## |
26 ## @example | |
27 ## @group | |
28 ## ax = gca (); | |
29 ## set (ax, "position", [0.5, 0.5, 0.5, 0.5]); | |
30 ## @end group | |
31 ## @end example | |
32 ## | |
33 ## @noindent | |
17126
eaab03308c0b
doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents:
16814
diff
changeset
|
34 ## creates an empty axes object, then changes its location and size in the |
eaab03308c0b
doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents:
16814
diff
changeset
|
35 ## figure window. |
eaab03308c0b
doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents:
16814
diff
changeset
|
36 ## @seealso{gcf, gco, gcbf, gcbo, get, set} |
6257 | 37 ## @end deftypefn |
38 | |
39 ## Author: jwe | |
40 | |
41 function h = gca () | |
42 | |
43 if (nargin == 0) | |
44 h = get (gcf (), "currentaxes"); | |
45 if (isempty (h)) | |
46 h = axes (); | |
47 endif | |
48 else | |
49 print_usage (); | |
50 endif | |
51 | |
52 endfunction | |
13123
6efa1a691713
Add further tests for scripts/plot.
Kai Habel <kai.habel@gmx.de>
parents:
11523
diff
changeset
|
53 |
14363
f3d52523cde1
Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
54 |
13123
6efa1a691713
Add further tests for scripts/plot.
Kai Habel <kai.habel@gmx.de>
parents:
11523
diff
changeset
|
55 %!test |
13124
2ea1658ad049
Don't use explicit figure number for tests to avoid interference with any figures opened by user.
Kai Habel <kai.habel@gmx.de>
parents:
13123
diff
changeset
|
56 %! hf = figure ("visible", "off"); |
13123
6efa1a691713
Add further tests for scripts/plot.
Kai Habel <kai.habel@gmx.de>
parents:
11523
diff
changeset
|
57 %! ax = axes; |
13141
e81ddf9cacd5
maint: untabify and remove trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
13124
diff
changeset
|
58 %! unwind_protect |
13123
6efa1a691713
Add further tests for scripts/plot.
Kai Habel <kai.habel@gmx.de>
parents:
11523
diff
changeset
|
59 %! assert (gca, ax); |
6efa1a691713
Add further tests for scripts/plot.
Kai Habel <kai.habel@gmx.de>
parents:
11523
diff
changeset
|
60 %! unwind_protect_cleanup |
6efa1a691713
Add further tests for scripts/plot.
Kai Habel <kai.habel@gmx.de>
parents:
11523
diff
changeset
|
61 %! close (hf); |
6efa1a691713
Add further tests for scripts/plot.
Kai Habel <kai.habel@gmx.de>
parents:
11523
diff
changeset
|
62 %! end_unwind_protect |
14363
f3d52523cde1
Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
63 |