M-File Help: trplot | View code for trplot

# trplot

Draw a coordinate frame

trplot(T, options) draws a 3D coordinate frame represented by the homogeneous transform T (4x4).

H = trplot(T, options) as above but returns a handle.

trplot(H, T) moves the coordinate frame described by the handle H to the pose T (4x4).

trplot(R, options) draws a 3D coordinate frame represented by the orthonormal rotation matrix R (3x3).

H = trplot(R, options) as above but returns a handle.

trplot(H, R) moves the coordinate frame described by the handle H to the orientation R.

## Options

'color', C | The color to draw the axes, MATLAB colorspec C
'noaxes' | Don't display axes on the plot
'axis', A | Set dimensions of the MATLAB axes to A=[xmin xmax ymin ymax zmin zmax]
'frame', F | The frame is named {F} and the subscript on the axis labels is F.
'text_opts', opt | A cell array of MATLAB text properties
'handle', H | Draw in the MATLAB axes specified by the axis handle H
'view', V | Set plot view parameters V=[az el] angles, or 'auto' for view toward origin of coordinate frame
'length', s | Length of the coordinate frame arms (default 1)
'arrow' | Use arrows rather than line segments for the axes
'width', w | Width of arrow tips (default 1)
'thick', t | Thickness of lines (default 0.5)
'3d' | Plot in 3D using anaglyph graphics
'anaglyph', A | Specify anaglyph colors for '3d' as 2 characters for left and right (default colors 'rc'):

    'r'   red
    'g'   green
    'b'   green
    'c'   cyan
    'm'   magenta

'dispar', D | Disparity for 3d display (default 0.1)
'text' | Enable display of X,Y,Z labels on the frame
'labels', L | Label the X,Y,Z axes with the 1st, 2nd, 3rd character of the string L
'rgb' | Display X,Y,Z axes in colors red, green, blue respectively

## Examples

    trplot(T, 'frame', 'A')
    trplot(T, 'frame', 'A', 'color', 'b')
    trplot(T1, 'frame', 'A', 'text_opts', {'FontSize', 10, 'FontWeight', 'bold'})
    trplot(T1, 'labels', 'NOA');

    h = trplot(T, 'frame', 'A', 'color', 'b');
    trplot(h, T2);

3D anaglyph plot

    trplot(T, '3d');

## Notes

- The arrow option requires the third party package arrow3.
- The handle H is an hgtransform object.
- When using the form TRPLOT(H, ...) the axes are not rescaled.
- The '3d' option requires that the plot is viewed with anaglyph glasses.
- You cannot specify 'color'

## See also

trplot2, tranimate

© 1990-2014 Peter Corke.