Mercurial > hg > octave-lyh
annotate scripts/plot/axes.m @ 17405:0bf2fc8562c9
doc: Update documentation for file and directory functions.
* libinterp/corefcn/dirfns.cc(Fpwd, Freaddir, Fmkdir, Frmdir, Freadlink, Ffnmatch): Redo docstring.
* libinterp/corefcn/dirfns.cc(Fcd): Redo docstring. Return previous working
directory if nargout > 0.
* libinterp/corefcn/dirfns.cc(Flink, Fsymlink, Frename): Redo docstring.
Re-order return values so that highest numbered value is assigned first to
avoid re-sizing octave_value_list each time.
* libinterp/corefcn/syscalls.cc(Flstat, Fmkfifo, FS_ISREG, FS_ISDIR, FS_ISCHR,
FS_ISBLK, FS_ISFIFO, FS_ISLNK, FS_ISSOCK): Redo docstring.
* scripts/general/isdir.m: Add more xrefs to @seealso.
* scripts/miscellaneous/copyfile.m: Add more xrefs to @seealso.
* scripts/miscellaneous/dir.m: Redo docstring.
* scripts/miscellaneous/ls.m: Add more xrefs to @seealso.m.
* scripts/miscellaneous/movefile.m: Add more xrefs to @seealso.
author | Rik <rik@octave.org> |
---|---|
date | Mon, 09 Sep 2013 14:30:31 -0700 |
parents | 1c89599167a6 |
children |
rev | line source |
---|---|
14138
72c96de7a403
maint: update copyright notices for 2012
John W. Eaton <jwe@octave.org>
parents:
13327
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 -*- | |
10793
be55736a0783
Grammarcheck the documentation from m-files.
Rik <octave@nomad.inbox5.com>
parents:
10549
diff
changeset
|
20 ## @deftypefn {Function File} {} axes () |
6257 | 21 ## @deftypefnx {Function File} {} axes (@var{property}, @var{value}, @dots{}) |
17126
eaab03308c0b
doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents:
17042
diff
changeset
|
22 ## @deftypefnx {Function File} {} axes (@var{hax}) |
17042
62d5f73e840c
axes.m: reorder figure children after setting the currentaxes (bug #39539).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14868
diff
changeset
|
23 ## @deftypefnx {Function File} {@var{h} =} axes (@dots{}) |
62d5f73e840c
axes.m: reorder figure children after setting the currentaxes (bug #39539).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14868
diff
changeset
|
24 ## Create an axes object and return a handle to it, or set the current |
17126
eaab03308c0b
doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents:
17042
diff
changeset
|
25 ## axes to @var{hax}. |
17042
62d5f73e840c
axes.m: reorder figure children after setting the currentaxes (bug #39539).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14868
diff
changeset
|
26 ## |
62d5f73e840c
axes.m: reorder figure children after setting the currentaxes (bug #39539).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14868
diff
changeset
|
27 ## Called without any arguments, or with @var{property}/@var{value} pairs, |
17126
eaab03308c0b
doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents:
17042
diff
changeset
|
28 ## construct a new axes. For accepted properties and corresponding |
eaab03308c0b
doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents:
17042
diff
changeset
|
29 ## values, @pxref{XREFset,,set}. |
17042
62d5f73e840c
axes.m: reorder figure children after setting the currentaxes (bug #39539).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14868
diff
changeset
|
30 ## |
17126
eaab03308c0b
doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents:
17042
diff
changeset
|
31 ## Called with a single axes handle argument @var{hax}, the function makes |
eaab03308c0b
doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents:
17042
diff
changeset
|
32 ## @var{hax} the current axis. It also restacks the axes in the |
eaab03308c0b
doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents:
17042
diff
changeset
|
33 ## corresponding figure so that @var{hax} is the first entry in the list |
eaab03308c0b
doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents:
17042
diff
changeset
|
34 ## of children. This causes @var{hax} to be displayed on top of any other |
17042
62d5f73e840c
axes.m: reorder figure children after setting the currentaxes (bug #39539).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14868
diff
changeset
|
35 ## axes objects (Z-order stacking). |
62d5f73e840c
axes.m: reorder figure children after setting the currentaxes (bug #39539).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14868
diff
changeset
|
36 ## |
62d5f73e840c
axes.m: reorder figure children after setting the currentaxes (bug #39539).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14868
diff
changeset
|
37 ## @seealso {gca, set, get} |
6257 | 38 ## @end deftypefn |
39 | |
40 ## Author: jwe | |
41 | |
42 function h = axes (varargin) | |
43 | |
44 if (nargin == 0 || nargin > 1) | |
13327
f81fcceb394c
axes: only update the currentaxes property of the parent figure if the axes object is visible
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
45 ## Create an axes object. |
6851 | 46 idx = find (strcmpi (varargin(1:2:end), "parent"), 1, "first"); |
47 if (! isempty (idx) && length (varargin) >= 2*idx) | |
48 cf = varargin{2*idx}; | |
49 varargin([2*idx-1, 2*idx]) = []; | |
50 else | |
51 cf = gcf (); | |
52 endif | |
17042
62d5f73e840c
axes.m: reorder figure children after setting the currentaxes (bug #39539).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14868
diff
changeset
|
53 htmp = __go_axes__ (cf, varargin{:}); |
62d5f73e840c
axes.m: reorder figure children after setting the currentaxes (bug #39539).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14868
diff
changeset
|
54 if (__is_handle_visible__ (htmp)) |
62d5f73e840c
axes.m: reorder figure children after setting the currentaxes (bug #39539).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14868
diff
changeset
|
55 set (ancestor (cf, "figure"), "currentaxes", htmp); |
13327
f81fcceb394c
axes: only update the currentaxes property of the parent figure if the axes object is visible
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
56 endif |
6688 | 57 else |
17042
62d5f73e840c
axes.m: reorder figure children after setting the currentaxes (bug #39539).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14868
diff
changeset
|
58 ## ARG is axes handle. |
62d5f73e840c
axes.m: reorder figure children after setting the currentaxes (bug #39539).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14868
diff
changeset
|
59 htmp = varargin{1}; |
17129
b5d6314314fc
Change various plot functions to take advantage of new isaxes() function.
Rik <rik@octave.org>
parents:
17126
diff
changeset
|
60 if (isscalar (htmp) && isaxes (htmp)) |
17042
62d5f73e840c
axes.m: reorder figure children after setting the currentaxes (bug #39539).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14868
diff
changeset
|
61 if (__is_handle_visible__ (htmp)) |
62d5f73e840c
axes.m: reorder figure children after setting the currentaxes (bug #39539).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14868
diff
changeset
|
62 parent = ancestor (htmp, "figure"); |
13327
f81fcceb394c
axes: only update the currentaxes property of the parent figure if the axes object is visible
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
63 set (0, "currentfigure", parent); |
17042
62d5f73e840c
axes.m: reorder figure children after setting the currentaxes (bug #39539).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14868
diff
changeset
|
64 set (parent, "currentaxes", htmp); |
62d5f73e840c
axes.m: reorder figure children after setting the currentaxes (bug #39539).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14868
diff
changeset
|
65 |
62d5f73e840c
axes.m: reorder figure children after setting the currentaxes (bug #39539).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14868
diff
changeset
|
66 ## restack |
62d5f73e840c
axes.m: reorder figure children after setting the currentaxes (bug #39539).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14868
diff
changeset
|
67 ch = get (parent, "children")(:); |
62d5f73e840c
axes.m: reorder figure children after setting the currentaxes (bug #39539).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14868
diff
changeset
|
68 idx = (ch == htmp); |
62d5f73e840c
axes.m: reorder figure children after setting the currentaxes (bug #39539).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14868
diff
changeset
|
69 ch = [ch(idx); ch(!idx)]; |
62d5f73e840c
axes.m: reorder figure children after setting the currentaxes (bug #39539).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14868
diff
changeset
|
70 set (parent, "children", ch); |
13327
f81fcceb394c
axes: only update the currentaxes property of the parent figure if the axes object is visible
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
71 endif |
6257 | 72 else |
17042
62d5f73e840c
axes.m: reorder figure children after setting the currentaxes (bug #39539).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14868
diff
changeset
|
73 error ("axes: H must be a scalar axes handle"); |
6257 | 74 endif |
75 endif | |
76 | |
77 if (nargout > 0) | |
17042
62d5f73e840c
axes.m: reorder figure children after setting the currentaxes (bug #39539).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
14868
diff
changeset
|
78 h = htmp; |
6257 | 79 endif |
80 | |
81 endfunction | |
17346
1c89599167a6
maint: End m-files with 1 blank line.
Rik <rik@octave.org>
parents:
17129
diff
changeset
|
82 |