This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

ParallelCoordinatesPlot Properties

Control parallel coordinates plot appearance and behavior

ParallelCoordinatesPlot properties control the appearance and behavior of a ParallelCoordinatesPlot object. By changing property values, you can modify certain aspects of the plot display. For example, you can add a title:

p = parallelplot(rand(10,4));
p.Title = 'My Title';

Labels

expand all

Plot title, specified as a character vector or string scalar. By default, the plot has no title.

Example: p = parallelplot(__,'Title','My Title Text')

Example: p.Title = 'My Title Text'

Horizontal axis label for describing the set of coordinate variables, specified as a character vector or string scalar. The CoordinateLabel value appears below the CoordinateTickLabels value in the plot.

Example: p = parallelplot(__,'CoordinateLabel','Measurements')

Example: p.CoordinateLabel = 'Measurements'

Coordinate variable labels, specified as a string array or cell array of character vectors. Each coordinate tick label appears directly below the ruler displaying the values for that coordinate variable.

Example: p = parallelplot(__,'CoordinateTickLabels',{'Height','Age','Smoker'})

Example: p.CoordinateTickLabels = {'Height','Age','Smoker'}

Vertical axis label for describing the rows of the data in SourceTable or Data, specified as a character vector or string scalar.

Example: p = parallelplot(__,'DataLabel','Patients')

Example: p.DataLabel = 'Patients'

Legend title, specified as a character vector of string scalar. Use '' for no title.

Example: p = parallelplot(__,'LegendTitle','My Title Text')

Example: p.LegendTitle = 'My Title Text'

Visibility of legend, specified as 'on' or 'off'. Set LegendVisible to 'on' to display the legend or 'off' to hide the legend.

If GroupData is empty ([]), then parallelplot does not display a legend. Otherwise, parallelplot displays a legend by default.

In the legend, parallelplot displays the group names in order of their first appearance in GroupData.

Example: p = parallelplot(__,'LegendVisible','off')

Example: p.LegendVisible = 'off'

Data Display

expand all

Normalization method for coordinates with numeric values, specified as one of the following options.

MethodDescription
'range'Display raw data along coordinate rulers that have independent minimum and maximum limits
'none'Display raw data along coordinate rulers that have the same minimum and maximum limits
'zscore'Display z-scores (with a mean of 0 and a standard deviation of 1) along each coordinate ruler
'scale'Display values scaled by standard deviation along each coordinate ruler
'center'Display data centered to have a mean of 0 along each coordinate ruler
'norm'Display 2-norm values along each coordinate ruler

For more information about these methods, see normalize.

For a coordinate variable that is a logical vector, datetime array, duration array, categorical array, string array, or cell array of character vectors, parallelplot evenly distributes the unique possible values along the coordinate ruler, regardless of the normalization method.

Example: p = parallelplot(__,'DataNormalization','none')

Example: p.DataNormalization = 'zscore'

Data displacement distance along the coordinate rulers, specified as a numeric scalar in the interval [0,1]. The Jitter value determines the maximum distance to displace plot lines from their true value along the coordinate rulers, where the displacement is a uniform random amount. If you set the Jitter property to 1, then adjacent jitter regions just touch. Set the Jitter property to 0 to display the true data values.

Some amount of jitter is particularly helpful for visualizing categorical data because the jittering enables you to distinguish between plot lines more easily. However, the Jitter value affects all coordinate variables, including numeric variables.

Example: p = parallelplot(__,'Jitter',0.5)

Example: p.Jitter = 0.2

Color and Styling

expand all

Group color, specified in one of these forms:

  • Character vector designating a color name, short name, or hexadecimal color code. A hexadecimal color code starts with a hash symbol (#) and is followed by three or six hexadecimal digits, which can range from 0 to F. The values are not case sensitive. Thus, the color codes '#FF8800', '#ff8800', '#F80', and '#f80' are equivalent.

  • String array or cell array of character vectors designating one or more color names, short names, or hexadecimal color codes.

  • Three-column matrix of RGB values in the range [0,1]. The three columns represent the R value, G value, and B value.

Choose among these predefined colors, their equivalent RGB triplets, and their hexadecimal color codes.

Color NameShort NameRGB TripletHexadecimal Color CodeAppearance
'red''r'[1 0 0]'#FF0000'

'green''g'[0 1 0]'#00FF00'

'blue''b'[0 0 1]'#0000FF'

'cyan' 'c'[0 1 1]'#00FFFF'

'magenta''m'[1 0 1]'#FF00FF'

'yellow''y'[1 1 0]'#FFFF00'

'black''k'[0 0 0]'#000000'

'white''w'[1 1 1]'#FFFFFF'

Here are the RGB triplets and hexadecimal color codes for the default colors MATLAB® uses in many types of plots.

RGB TripletHexadecimal Color CodeAppearance
[0 0.4470 0.7410]'#0072BD'

[0.8500 0.3250 0.0980]'#D95319'

[0.9290 0.6940 0.1250]'#EDB120'

[0.4940 0.1840 0.5560]'#7E2F8E'

[0.4660 0.6740 0.1880]'#77AC30'

[0.3010 0.7450 0.9330]'#4DBEEE'

[0.6350 0.0780 0.1840]'#A2142F'

By default, parallelplot assigns a maximum of seven unique group colors. When the total number of groups exceeds the number of specified colors, parallelplot cycles through the specified colors.

Example: p = parallelplot(__,'Color',{'blue','black','green'})

Example: p.Color = [0 0 1; 0 0.5 0.5; 0.5 0.5 0.5]

Example: p.Color = {'#EDB120','#77AC30','#7E2F8E'}

Group line style, specified in one of these forms:

  • Character vector designating one line style

  • String array or cell array of character vectors designating one or more line styles

Choose among these line style options.

Line StyleDescriptionResulting Line
'-'Solid line

'--'Dashed line

':'Dotted line

'-.'Dash-dotted line

'none'No lineNo line

By default, parallelplot assigns a line style of '-' to each group of plot lines. When the total number of groups exceeds the number of specified line styles, parallelplot cycles through the specified line styles.

Example: p = parallelplot(__,'LineStyle',':')

Example: p.LineStyle = {'-.','-','--'}

Group line width, specified as a positive scalar or positive vector in points. By default, parallelplot assigns a line width of 1 to each group of plot lines.

When the total number of groups exceeds the number of specified line widths, parallelplot cycles through the specified line widths.

Example: p = parallelplot(__,'LineWidth',1.5)

Example: p.LineWidth = [0.5 1.5 0.5]

Group line transparency, specified as a numeric scalar or numeric vector with values between 0 and 1. Values closer to 0 specify more transparent lines, and values closer to 1 specify more opaque lines. By default, parallelplot assigns a LineAlpha value of 0.7 to each group of plot lines.

Example: p = parallelplot(__,'LineAlpha',0.75)

Example: p.LineAlpha = [0.2 0.7 0.4]

Group marker symbol for data values along the coordinate rulers, specified in one of these forms:

  • Character vector designating a marker style

  • String array or cell array of character vectors designating one or more marker styles

Choose among these marker options.

ValueDescription
'o'Circle
'+'Plus sign
'*'Asterisk
'.'Point
'x'Cross
'square' or 's'Square
'diamond' or 'd'Diamond
'^'Upward-pointing triangle
'v'Downward-pointing triangle
'>'Right-pointing triangle
'<'Left-pointing triangle
'pentagram' or 'p'Five-pointed star (pentagram)
'hexagram' or 'h'Six-pointed star (hexagram)
'none'No markers

By default, parallelplot assigns 'none' as the marker style for each group. When the total number of groups exceeds the number of specified symbols, parallelplot cycles through the specified symbols.

Example: p = parallelplot(__,'MarkerStyle','x')

Example: p.MarkerStyle = {'x','o'}

Group marker size for data values along the coordinate rulers, specified as a nonnegative scalar or nonnegative vector, with values measured in points. By default, parallelplot assigns 6 as the marker size for each group. When the total number of groups exceeds the number of specified values, parallelplot cycles through the specified values.

Example: p = parallelplot(__,'MarkerSize',10)

Example: p.MarkerSize = [4 6 8]

Font

expand all

Font name, specified as a system-supported font name. The same font is used for the title, labels, legend title, and group names. The default font depends on the specific operating system and locale.

Example: p = parallelplot(__,'FontName','Cambria')

Example: p.FontName = 'Helvetica'

Font size, specified as a positive scalar. FontSize is the same for the title, labels, legend title, and group names. The default font size depends on the specific operating system and locale.

As you adjust the size of plot elements, the software automatically updates the font size. However, changing the FontSize property disables this automatic resizing.

Example: p = parallelplot(__,'FontSize',12)

Example: p.FontSize = 10

Position

expand all

Position property to hold constant during resizing operations, specified as 'outerposition' or 'innerposition'. The default value of 'outerposition' means that the OuterPosition property remains constant. The InnerPosition property value can change when the parent container changes size, the data changes, or the labels change.

Example: p.ActivePositionProperty = 'outerposition'

Inner size and position of the plot within the parent container (typically a figure, panel, or tab), specified as a four-element numeric vector of the form [left bottom width height]. The inner position does not include the plot title, labels, or legend.

  • The left and bottom elements define the distance from the lower left corner of the container to the lower left corner of the plot.

  • The width and height elements are the dimensions of the plot.

Outer size and position of the full parallel coordinates plot within the parent container (typically a figure, panel, or tab), specified as a four-element numeric vector of the form [left bottom width height]. The default value of [0 0 1 1] includes the whole interior of the container.

Inner size and position of the plot within the parent container (typically a figure, panel, or tab), specified as a four-element numeric vector of the form [left bottom width height]. This property is equivalent to the InnerPosition property.

Position units, specified as one of these values.

ValueDescription
'normalized' (default)Normalized with respect to the container, which is typically the figure or a panel. The lower left corner of the container maps to (0,0), and the upper right corner maps to (1,1).
'inches'Inches.
'centimeters'Centimeters.
'characters'

Based on the default uicontrol font of the graphics root object:

  • Character width is equal to the width of the letter x

  • Character height is equal to the distance between the baselines of two lines of text

'points'Typography points. One point equals 1/72 inch.
'pixels'

Pixels.

Starting in R2015b, distances in pixels are independent of your system resolution on Windows® and Macintosh systems:

  • On Windows systems, a pixel is 1/96 inch

  • On Macintosh systems, a pixel is 1/72 inch

On Linux® systems, the size of a pixel is determined by your system resolution.

When specifying the units as a name-value pair during object creation, you must set the Units property before specifying the properties that you want to use these units for, such as OuterPosition.

Visibility of object, specified as one of these values:

  • 'on' — Display the ParallelCoordinatesPlot object.

  • 'off' — Hide the ParallelCoordinatesPlot object without deleting it. You can still access the properties of an invisible ParallelCoordinatesPlot object.

Table Data

expand all

Source table, specified as a table.

You can create a table from workspace variables using the table function, or you can import data as a table using the readtable function.

Note

The property is ignored and read-only when you use matrix data instead of tabular data.

Table variables to display as coordinates, specified in one of these forms:

  • Numeric vector — Indicating the indices of the table variables

  • String array or cell array of character vectors — Indicating the names of the table variables

  • Logical vector — Containing true elements for the selected table variables

If you set the CoordinateVariables property value, then the CoordinateData and CoordinateTickLabels properties update to appropriate values.

Note

The property is ignored and read-only when you use matrix data instead of tabular data.

Example: p.CoordinateVariables = {'Age','Height','Weight'} specifies the variables named 'Age', 'Height', and 'Weight'.

Table variable for grouping data, specified in one of these forms:

  • Character vector or string scalar — Indicating one of the table variable names

  • Numeric scalar — Indicating the table variable index

  • Logical vector — Containing one true element for the table variable

The values associated with your table variable must form a numeric vector, logical vector, categorical array, string array, or cell array of character vectors.

GroupVariable splits the rows in SourceTable into unique groups. parallelplot assigns each group a default color. In the legend, parallelplot displays the group names in order of their first appearance in GroupData.

When you specify GroupVariable, MATLAB updates the GroupData property values.

Note

This property is ignored and read-only when you use matrix data instead of tabular data.

Example: p.GroupVariable = 'Smoker'

Matrix Data

expand all

Input data, specified as a numeric matrix.

Note

If you are using tabular data, you cannot set this property.

Variables displayed as coordinates, specified in one of these forms:

  • Numeric vector — Indicating the columns of the source table or input data matrix

  • Logical vector — Containing true elements for the selected columns of the source table or input data matrix

Note

If you are using tabular data, you cannot set this property. The value of CoordinateData automatically updates based on the table variables you select with the CoordinateVariables property.

Example: p.CoordinateData = [1 5:7]

Values for grouping data, specified as a numeric vector, logical vector, categorical array, string array, or cell array of character vectors.

GroupData splits the rows in SourceTable or Data into unique groups. parallelplot assigns each group a default color. In the legend, parallelplot displays the group names in order of their first appearance in GroupData.

Note

If you are using tabular data, you cannot set this property. The GroupData values automatically populate based on the table variable you select with the GroupVariable property.

Example: p.GroupData = [1 2 1 3 2 1 3 3 2 3]

Example: p.GroupData = categorical({'blue','red','yellow','blue','yellow','red','red','yellow','blue','red'})

Parent/Child

expand all

Parent container in which to plot, specified as a Figure, Panel, or Tab object.

Visibility of the object handle for ScatterHistogramChart in the Children property of the parent, specified as one of these values:

  • 'on' — Object handle is always visible.

  • 'off' — Object handle is always invisible. This option is useful for preventing unintended changes to the UI by another function. To temporarily hide the handle during the execution of that function, set the HandleVisibility to 'off'.

  • 'callback' — Object handle is visible from within callbacks or functions invoked by callbacks, but not from within functions invoked from the command line. This option blocks access to the object at the command line, but allows callback functions to access it.

If the object is not listed in the Children property of the parent, then functions that obtain object handles by searching the object hierarchy or querying handle properties cannot return the object. These functions include get, findobj, gca, gcf, gco, newplot, cla, clf, and close.

Hidden object handles are still valid. Set the root ShowHiddenHandles property to 'on' to list all object handles, regardless of their HandleVisibility property setting.

Introduced in R2019a