Documentation

andrewsplot

Andrews plot

Syntax

andrewsplot(X)
andrewsplot(X,...,'Standardize',standopt)
andrewsplot(X,...,'Quantile',alpha)
andrewsplot(X,...,'Group',group)
andrewsplot(X,...,'PropName',PropVal,...)
h = andrewsplot(X,...)

Description

andrewsplot(X)创建一个安德鲁斯th的阴谋e multivariate data in the matrixX. The rows ofXcorrespond to observations, the columns to variables. Andrews plots represent each observation by a functionf(t) of a continuous dummy variabletover the interval [0,1].f(t) is defined for theith observation inXas

f ( t ) = X ( i , 1 ) / 2 + X ( i , 2 ) sin ( 2 π t ) + X ( i , 3 ) cos ( 2 π t ) +

andrewsplottreatsNaNvalues inXas missing values and ignores the corresponding rows.

andrewsplot(X,...,'Standardize',standopt)creates an Andrews plot wherestandoptis one of the following:

  • 'on'— scales each column ofXto have mean0and standard deviation1before making the plot.

  • 'PCA'— creates an Andrews plot from the principal component scores ofX, in order of decreasing eigenvalue. (Seepca.)

  • 'PCAStd'— creates an Andrews plot using the standardized principal component scores. (Seepca.)

andrewsplot(X,...,'Quantile',alpha)plots only the median and thealphaand (1 –alpha) quantiles off(t) at each value oft. This is useful ifXcontains many observations.

andrewsplot(X,...,'Group',group)plots the data in different groups with different colors. Groups are defined bygroup, a numeric array containing a group index for each observation.groupcan also be a categorical array, character matrix, or cell array of character vectors containing a group name for each observation.

andrewsplot(X,...,'PropName',PropVal,...)sets optional lineseries object properties to the specified values for all lineseries objects created byandrewsplot. (SeeChart Line Properties.)

h = andrewsplot(X,...)returns a column vector of handles to the lineseries objects created byandrewsplot, one handle per row ofX. If you use the'Quantile'input parameter,hcontains one handle for each of the three lineseries objects created. If you use both the'Quantile'and the'Group'input parameters,hcontains three handles for each group.

Examples

collapse all

This example shows how to create an Andrews plot to visualize grouped sample data.

Load the sample data.

loadfisheriris

Create an Andrews plot, grouping the sample data byspecies.

andrewsplot(meas,'group',species)

Create a second, simplified Andrews plot that only displays the median and quartiles of each group.

andrewsplot(meas,'group',species,'quantile',.25)

Introduced before R2006a

Was this topic helpful?