changeset 24407:5528840346e7 stable

doc: Improve documentation for findobj, findall. * findall.m, findobj.m: Improve docstrings.
author Rik <rik@octave.org>
date Wed, 13 Dec 2017 08:33:09 -0800
parents f6016eeb27ec
children a9be96afb39e
files scripts/plot/util/findall.m scripts/plot/util/findobj.m
diffstat 2 files changed, 30 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/plot/util/findall.m	Mon Dec 11 15:04:07 2017 -0800
+++ b/scripts/plot/util/findall.m	Wed Dec 13 08:33:09 2017 -0800
@@ -25,7 +25,7 @@
 ## @deftypefnx {} {@var{h} =} findall (@var{hlist}, @dots{})
 ## @deftypefnx {} {@var{h} =} findall (@var{hlist}, "flat", @dots{})
 ## @deftypefnx {} {@var{h} =} findall (@var{hlist}, "-depth", @var{d}, @dots{})
-## Find graphics object, including hidden ones, with specified property values.
+## Find graphics object, including hidden ones, with specified properties.
 ##
 ## The return value @var{h} is a list of handles to the found graphic objects.
 ##
--- a/scripts/plot/util/findobj.m	Mon Dec 11 15:04:07 2017 -0800
+++ b/scripts/plot/util/findobj.m	Wed Dec 13 08:33:09 2017 -0800
@@ -25,9 +25,12 @@
 ## @deftypefnx {} {@var{h} =} findobj (@var{hlist}, @dots{})
 ## @deftypefnx {} {@var{h} =} findobj (@var{hlist}, "flat", @dots{})
 ## @deftypefnx {} {@var{h} =} findobj (@var{hlist}, "-depth", @var{d}, @dots{})
-## Find graphics object with specified property values.
+## Find graphics objects with specified properties.
 ##
-## The simplest form is
+## When called without arguments, return all graphic objects beginning with the
+## root object (0) and including all of its descendants.
+##
+## The simplest form for narrowing the results is
 ##
 ## @example
 ## findobj (@var{prop_name}, @var{prop_value})
@@ -37,39 +40,49 @@
 ## which returns the handles of all objects which have a property named
 ## @var{prop_name} that has the value @var{prop_value}.  If multiple
 ## property/value pairs are specified then only objects meeting all of the
-## conditions are returned.
+## conditions (equivalent to @code{-and}) are returned.
 ##
 ## The search can be limited to a particular set of objects and their
 ## descendants, by passing a handle or set of handles @var{hlist} as the first
 ## argument.
 ##
 ## The depth of the object hierarchy to search can be limited with the
-## @qcode{"-depth"} argument.  An example of searching only three generations
-## of children is:
+## @qcode{"-depth"} argument.  An example of searching through only three
+## generations of children is:
 ##
 ## @example
 ## findobj (@var{hlist}, "-depth", 3, @var{prop_name}, @var{prop_value})
 ## @end example
 ##
-## Specifying a depth @var{d} of 0, limits the search to the set of objects
-## passed in @var{hlist}.  A depth @var{d} of 0 is equivalent to the
-## @qcode{"flat"} argument.
+## Specifying a depth @var{d} of 0 limits the search to the set of objects
+## passed in @var{hlist}.  A depth of 0 is also equivalent to the
+## @qcode{"flat"} argument.  The default depth value is @code{Inf} which
+## includes all descendants.
 ##
-## A specified logical operator may be applied to the pairs of @var{prop_name}
-## and @var{prop_value}.  The supported logical operators are:
-## @qcode{"-and"}, @qcode{"-or"},
-## @qcode{"-xor"}, @qcode{"-not"}.
+## A specified logical operator may be used between @var{prop_name},
+## @var{prop_value} pairs.  The supported logical operators are: @qcode{"-and"},
+## @qcode{"-or"}, @qcode{"-xor"}, @qcode{"-not"}.  Example code to locate all
+## figure and axes objects is
+##
+## @example
+## findobj ("type", "figure", "-or", "type", "axes")
+## @end example
 ##
 ## Objects may also be matched by comparing a regular expression to the
 ## property values, where property values that match
 ## @code{regexp (@var{prop_value}, @var{pattern})} are returned.
 ##
-## Finally, objects may be matched by property name only by using the
-## @qcode{"-property"} option.
+## Finally, objects which have a property name can be found with the 
+## @qcode{"-property"} option.  For example, code to locate objects with a
+## @qcode{"meshstyle"} property is
+##
+## @example
+## findobj ("-property", "meshstyle")
+## @end example
 ##
 ## Implementation Note: The search only includes objects with visible
-## handles (HandleVisibility = @qcode{"on"}).  @xref{XREFfindall,,findall}, to
-## search for all objects including hidden ones.
+## handles (@w{HandleVisibility} = @qcode{"on"}).  @xref{XREFfindall,,findall},
+## to search for all objects including hidden ones.
 ## @seealso{findall, allchild, get, set}
 ## @end deftypefn