changeset 6891:e9921bb3d95b

[project @ 2007-09-13 02:44:27 by jwe]
author jwe
date Thu, 13 Sep 2007 02:44:27 +0000
parents b2b7526a5772
children 29fa8673d8d1
files doc/interpreter/plot.txi
diffstat 1 files changed, 87 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/doc/interpreter/plot.txi	Wed Sep 12 20:14:35 2007 +0000
+++ b/doc/interpreter/plot.txi	Thu Sep 13 02:44:27 2007 +0000
@@ -344,6 +344,7 @@
 @menu
 * Graphics Objects::
 * Graphics Object Properties::  
+* Managing Default Properties::  
 * Colors::
 * Line Styles::
 * Marker Styles::
@@ -837,6 +838,92 @@
 future version of Octave.
 @end table
 
+@node Managing Default Properties
+@subsection Managing Default Properties
+
+Object properties have to classes of default values, @dfn{factory}
+defaults (the initial values) and @dfn{user} defaults, which may
+override the factory defaults.
+
+Although default values may be set for any object, they are set in
+parent objects and apply to child objects.  For example,
+
+@example
+set (0, "defaultlinecolor", "green");
+@end example
+
+@noindent
+sets the default line color for all objects.  The rule for constructing
+the property name to set a default value is
+
+@example
+default + @var{object-type} + @var{property-name}
+@end example
+
+This rule can lead to some strange looking names, for example
+@code{defaultlinelinewidth"} specifies the default @code{linewidth}
+property for @code{line} objects.
+
+The example above used the root figure object, 0, so the default
+property value will apply to all line objects.  However, default values
+are hierarchical, so defaults set in a figure objects override those
+set in the root figure object.  Likewise, defaults set in axes objects
+override those set in figure or root figure objects.  For example,
+
+@example
+@group
+subplot (2, 1, 1);
+set (0, "defaultlinecolor", "red");
+set (1, "defaultlinecolor", "green");
+set (gca (), "defaultlinecolor", "blue");
+line (1:10, rand (1, 10));
+subplot (2, 1, 2);
+line (1:10, rand (1, 10));
+figure (2)
+line (1:10, rand (1, 10));
+@end group
+@end example
+
+@noindent
+produces two figures.  The line in first subplot window of the first
+figure is blue because it inherits its color from its parent axes
+object.  The line in the second subplot window of the first figure is
+green because it inherits its color from its parent figure object.  The
+line in the second figure window is red because it inherits its color
+from the global root figure parent object.
+
+To remove a user-defined default setting, set the default property to
+the value @code{"remove"}.  For example,
+
+@example
+set (gca (), "defaultlinecolor", "remove");
+@end example
+
+@noindent
+removes the user-defined default line color setting from the current axes
+object.
+
+Getting the @code{"default"} property of an object returns a list of
+user-defined defaults set for the object.  For example,
+
+@example
+get (gca (), "default");
+@end example
+
+@noindent
+returns a list of user-defined default values for the current axes
+object.
+
+Factory default values are stored in the root figure object.  The
+command
+
+@example
+get (0, "factory");
+@end example
+
+@noindent
+returns a list of factory defaults.
+
 @node Colors
 @subsection Colors