annotate scripts/plot/gco.m @ 16808:772f51539af8

doc: Add gco() to documentation. * doc/interpreter/plot.txi: Add gco() to manual. * scripts/plot/gco.m: Add seealso links to docstring. * scripts/plot/gcbf.m: Re-arrange seealso links. Improve docstring. * scripts/plot/gcbo.m: Rewrite second paragraph of docstring. Add seealso link to gco.
author Rik <rik@octave.org>
date Sat, 22 Jun 2013 11:16:04 -0700
parents fa8f3955e70a
children 64e7bb01fce2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
14837
c55493bb7363 Add gco implementation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
1 ## Copyright (C) 2012 Michael Goffioul
c55493bb7363 Add gco implementation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
2 ##
c55493bb7363 Add gco implementation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
3 ## This file is part of Octave.
c55493bb7363 Add gco implementation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
4 ##
c55493bb7363 Add gco implementation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
5 ## Octave is free software; you can redistribute it and/or modify it
c55493bb7363 Add gco implementation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
6 ## under the terms of the GNU General Public License as published by
c55493bb7363 Add gco implementation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
7 ## the Free Software Foundation; either version 3 of the License, or (at
c55493bb7363 Add gco implementation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
8 ## your option) any later version.
c55493bb7363 Add gco implementation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
9 ##
c55493bb7363 Add gco implementation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
10 ## Octave is distributed in the hope that it will be useful, but
c55493bb7363 Add gco implementation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
c55493bb7363 Add gco implementation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
c55493bb7363 Add gco implementation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
13 ## General Public License for more details.
c55493bb7363 Add gco implementation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
14 ##
c55493bb7363 Add gco implementation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
15 ## You should have received a copy of the GNU General Public License
c55493bb7363 Add gco implementation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
16 ## along with Octave; see the file COPYING. If not, see
c55493bb7363 Add gco implementation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
17 ## <http://www.gnu.org/licenses/>.
c55493bb7363 Add gco implementation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
18
c55493bb7363 Add gco implementation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
19 ## -*- texinfo -*-
c55493bb7363 Add gco implementation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
20 ## @deftypefn {Function File} {@var{h} =} gco ()
c55493bb7363 Add gco implementation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
21 ## @deftypefnx {Function File} {@var{h} =} gco (@var{fig})
c55493bb7363 Add gco implementation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
22 ## Return a handle to the current object of the current figure, or a handle
15007
8f0e3c5bfa5f doc: Periodic grammarcheck of documentation
Rik <rik@octave.org>
parents: 14837
diff changeset
23 ## to the current object of the figure with handle @var{fig}. The current
8f0e3c5bfa5f doc: Periodic grammarcheck of documentation
Rik <rik@octave.org>
parents: 14837
diff changeset
24 ## object of a figure is the object that was last clicked on. It is stored
14837
c55493bb7363 Add gco implementation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
25 ## in the CurrentObject property of the target figure.
c55493bb7363 Add gco implementation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
26 ##
c55493bb7363 Add gco implementation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
27 ## If the last mouse click didn't occur on any child object of the figure,
c55493bb7363 Add gco implementation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
28 ## the current object is the figure itself.
c55493bb7363 Add gco implementation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
29 ##
15010
f7bcfb3b96e7 doc: Fix typo in docstring for gco.m
Rik <rik@octave.org>
parents: 15007
diff changeset
30 ## If no mouse click occured in the target figure, this function returns an
14837
c55493bb7363 Add gco implementation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
31 ## empty matrix.
c55493bb7363 Add gco implementation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
32 ##
c55493bb7363 Add gco implementation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
33 ## Note that the value returned by this function is not necessarily the same
15007
8f0e3c5bfa5f doc: Periodic grammarcheck of documentation
Rik <rik@octave.org>
parents: 14837
diff changeset
34 ## as the one returned by gcbo during callback execution. An executing
14837
c55493bb7363 Add gco implementation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
35 ## callback can be interrupted by another callback and the current object
c55493bb7363 Add gco implementation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
36 ## can be modified.
c55493bb7363 Add gco implementation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
37 ##
16808
772f51539af8 doc: Add gco() to documentation.
Rik <rik@octave.org>
parents: 15246
diff changeset
38 ##@seealso{gcbo, gcf, gca}
14837
c55493bb7363 Add gco implementation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
39 ##@end deftypefn
c55493bb7363 Add gco implementation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
40
c55493bb7363 Add gco implementation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
41 function h = gco ()
c55493bb7363 Add gco implementation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
42
15246
fa8f3955e70a gco.m: Don't create figure if it doesn't already exist (Bug #37211)
Rik <rik@octave.org>
parents: 15010
diff changeset
43 h = get (get (0, "currentfigure"), "currentobject");
14837
c55493bb7363 Add gco implementation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
44
c55493bb7363 Add gco implementation.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
45 endfunction