# HG changeset patch # User jwe # Date 1189651467 0 # Node ID e9921bb3d95b31c18c7bb19318aea622fdcac0b8 # Parent b2b7526a57722463975bedf08ff38ecd4d74abd7 [project @ 2007-09-13 02:44:27 by jwe] diff --git a/doc/interpreter/plot.txi b/doc/interpreter/plot.txi --- a/doc/interpreter/plot.txi +++ b/doc/interpreter/plot.txi @@ -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