hgtransform
Transform graphics objects
Description
h = hgtransform creates a Transform object
in the current axes. If no axes exist, then hgtransform creates
new axes. Use h to query and set properties of the
Transform object after creating it. For a list of properties,
see Transform Properties.
You can use a Transform object as a container for transforming a
group of graphics objects without having to modify the coordinate data of each
object. Group objects by parenting them to a single Transform
object, and then and perform transformations, such as
translations, scaling, and rotations, on the Transform object to
modify the child objects as a group.
h = hgtransform( sets
properties of the Name,Value)Transform object using one or more name-value
arguments. For example, hgtransform(Matrix=M) creates a
Transform object with transform matrix M in
the current axes. For a list of properties, see Transform Properties.
Examples
Input Arguments
Name-Value Arguments
Limitations
A
Transformobject can be the parent to any number of graphics objects, but it can contain only objects from the same axes.
Tips
Many plotting functions clear the axes (remove axes children) before drawing the graph. Clearing the axes also deletes any
Transformobjects in the axes. For example, if you create aTransformobject and then useplot, theTransformobject is deleted.h = hgtransform; p = plot(1:10); h.Matrix;
Invalid or deleted object.
You can return the child objects of a
Transformobject to their original orientation, position, and size by setting the transform matrix to the identity matrix. For example, return the child objects of transformtto their original state after applying the transform matrixM.Transform operations are defined in absolute terms rather than relative to the current transform, so the identity matrix resets all previous transformations. For more information on the identity matrix, see thet = hgtransform(Matrix=M); ... t.Matrix = eye(4);eyefunction.You can parent a
Textobject to aTransformobject, but scaling and rotating transform has no effect on the text. To change the font size and orientation of the text, instead set text properties, such asTextSizeandRotation. For more information, see Text Properties.You can parent a
Lightobject to aTransformobject, but the transformations do not affect the position of the light. To modify the position and orientation of a light source, instead set thePositionproperty of theLightobject. For more information, see Light Properties.
Version History
Introduced before R2006a





