3D scatter plot from quaternion array.
(Quaternion overloading of standard MATLAB® function)
h = scatter3(q, varargin)
scatter3 plots a 3D scatter plot of elements in a pure quaternion vector. It supports the same parameter profiles as the MATLAB® function of the same name, except that the first three parameters (X, Y, Z) are replaced by a single quaternion parameter, which must be a pure quaternion vector.
If two parameters are given and the second is 'rgb' or 'seq', a coloured scatter plot is produced. 'rgb' colours the plotted points according to the direction of the position vector of the point from the origin using the convention of X = red, Y = green and Z = blue (the standard RGB colour space used in image processing). This is useful when the spatial position of points is of interest. 'seq' colours the points in a graded sequence of progressively darker values matching the sequence of points in the quaternion vector Q. This is useful when the ordering of the points is of interest.
If more than one varargin parameter is given, or the first is neither 'rgb' nor 'seq', the varargin parameters are passed to the Matlab scatter3 function, and must therefore conform to the requirements of that function.
The output parameter is optional, with the same functionality as the corresponding MATLAB® function (a graphics handle).
For more sophisticated requirements, use the Matlab function and pass the X, Y and Z components of the quaternion array as the first three parameters.
>> scatter3(randv(1,128), 'rgb'); axis equal
results in the creation of the following plot.