set
Set graphics object properties
Syntax
Description
set( sets
properties for the specified graphics object h,Name,Value)h using one or more
name-value arguments. If h is a vector of objects, then
set sets the properties for all the objects in
h. If h is empty ([ ]), set
does nothing and does not return an error or warning.
For more information about properties that you can set, see the property pages for each
object, for example, Figure, Axes Properties, Line Properties, and Text Properties.
set(
changes the default value of the specified property and object type for the specified
graphics object h,defaultTypeProperty,defaultValue)h using one or more pairs of property names and values.
defaultTypeProperty is the word default
concatenated with the object type (for example, Figure) and the property
name (for example, Color) in quotes. For example,
set(groot,"defaultFigureColor","red") changes the default value of the
Color property of Figure objects to
red for the graphics root object, groot.
set(
sets multiple properties for the specified graphics object h,NameArray,ValueArray)h.
If
his a scalar object, specifyNameArrayandValueArrayas 1-by-n cell arrays containing one or more property names or values, where n is the number of properties being set.If
his a vector of objects, to set a different property value for each object inh, specifyValueArrayas an m-by-n cell array, where m is the number of elements inhand n is the number of property names contained inNameArray.
returns the possible values for the specified property. If the possible values are character
vectors or strings, v = set(h,propertyName)set returns a cell array containing the values. For
other properties that do not have a fixed set of values, set returns an
empty cell array. h must be a single object. This syntax does not change
the properties of h.
If v is not specified, set displays the
possible values in the Command Window.
Examples
Input Arguments
Output Arguments
Tips
When setting the
FontSizeandFontUnitsproperties in the samesetstatement, specify theFontUnitsproperty first. This order allows thesetfunction to interpret the specifiedFontSizeas intended. Similarly, when setting figure and axes units, set theUnitsproperty before setting additional properties whose values are calculated using the specified units. For example, this command sets theUnitsproperty before setting thePositionproperty, whose measurements are in units specified by theUnitsproperty.f = figure; set(f,"Units","characters","Position",[30 30 120 35]);
Version History
Introduced before R2006a




