Main Content

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, string array, cell array of character vectors, or categorical array. By default, the plot has no title.

To create a multiline title, specify a string array or cell array of character vectors. Each element in the array corresponds to a line of text.

If you specify the title as a categorical array, MATLAB® uses the values in the array, not the categories.

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

Example: p.Title = 'My Title Text'

Example: p.Title = {'My','Title'}

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

To create a multiline label, specify a string array or cell array of character vectors. Each element in the array corresponds to a line of text.

If you specify the label as a categorical array, MATLAB uses the values in the array, not the categories.

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

Example: p.CoordinateLabel = 'Measurements'

Example: p.CoordinateLabel = {'Measurements','(in inches)'}

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

If you specify the labels as a categorical array, MATLAB uses the values in the array, not the categories.

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, string array, cell array of character vectors, or categorical array.

To create a multiline label, specify a string array or cell array of character vectors. Each element in the array corresponds to a line of text.

If you specify the label as a categorical array, MATLAB uses the values in the array, not the categories.

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

Example: p.DataLabel = 'Patients'

Example: p.DataLabel = {'Patients','(data set 1)'}

Legend title, specified as a character vector, string array, cell array of character vectors, or categorical array. Use '' for no title.

To create a multiline title, specify a string array or cell array of character vectors. Each element in the array corresponds to a line of text.

If you specify the title as a categorical array, MATLAB uses the values in the array, not the categories.

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

Example: p.LegendTitle = 'My Title Text'

Example: p.LegendTitle = {'My','Title'}

Visibility of legend, specified as 'on' or 'off', or as numeric or logical 1 (true) or 0 (false). A value of 'on' is equivalent to true, and 'off' is equivalent to false. Thus, you can use the value of this property as a logical value. The value is stored as an on/off logical value of type matlab.lang.OnOffSwitchState.

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"

Sample of the color red

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

Sample of the color green

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

Sample of the color blue

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

Sample of the color cyan

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

Sample of the color magenta

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

Sample of the color yellow

"black""k"[0 0 0]"#000000"

Sample of the color black

"white""w"[1 1 1]"#FFFFFF"

Sample of the color white

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"

Sample of RGB triplet [0 0.4470 0.7410], which appears as dark blue

[0.8500 0.3250 0.0980]"#D95319"

Sample of RGB triplet [0.8500 0.3250 0.0980], which appears as dark orange

[0.9290 0.6940 0.1250]"#EDB120"

Sample of RGB triplet [0.9290 0.6940 0.1250], which appears as dark yellow

[0.4940 0.1840 0.5560]"#7E2F8E"

Sample of RGB triplet [0.4940 0.1840 0.5560], which appears as dark purple

[0.4660 0.6740 0.1880]"#77AC30"

Sample of RGB triplet [0.4660 0.6740 0.1880], which appears as medium green

[0.3010 0.7450 0.9330]"#4DBEEE"

Sample of RGB triplet [0.3010 0.7450 0.9330], which appears as light blue

[0.6350 0.0780 0.1840]"#A2142F"

Sample of RGB triplet [0.6350 0.0780 0.1840], which appears as dark red

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

Sample of solid line

"--"Dashed line

Sample of dashed line

":"Dotted line

Sample of dotted line

"-."Dash-dotted line

Sample of dash-dotted line, with alternating dashes and dots

"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.

MarkerDescriptionResulting Marker
"o"Circle

Sample of circle marker

"+"Plus sign

Sample of plus sign marker

"*"Asterisk

Sample of asterisk marker

"."Point

Sample of point marker

"x"Cross

Sample of cross marker

"_"Horizontal line

Sample of horizontal line marker

"|"Vertical line

Sample of vertical line marker

"square"Square

Sample of square marker

"diamond"Diamond

Sample of diamond marker

"^"Upward-pointing triangle

Sample of upward-pointing triangle marker

"v"Downward-pointing triangle

Sample of downward-pointing triangle marker

">"Right-pointing triangle

Sample of right-pointing triangle marker

"<"Left-pointing triangle

Sample of left-pointing triangle marker

"pentagram"Pentagram

Sample of pentagram marker

"hexagram"Hexagram

Sample of hexagram marker

"none"No markersNot applicable

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 when adding, removing, or changing decorations, specified as one of the following values:

  • "outerposition" — The OuterPosition property remains constant when you add, remove, or change decorations such as a title or an axis label. If any positional adjustments are needed, MATLAB adjusts the InnerPosition property.

  • "innerposition" — The InnerPosition property remains constant when you add, remove, or change decorations such as a title or an axis label. If any positional adjustments are needed, MATLAB adjusts the OuterPosition property.

Note

Setting this property has no effect when the parent container is a TiledChartLayout object.

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.

Note

Setting this property has no effect when the parent container is a TiledChartLayout object.

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.

Note

Setting this property has no effect when the parent container is a TiledChartLayout object.

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.

Note

Setting this property has no effect when the parent container is a TiledChartLayout object.

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.

Layout options, specified as a TiledChartLayoutOptions or GridLayoutOptions object. This property is useful when the chart is either in a tiled chart layout or a grid layout.

To position the chart within the grid of a tiled chart layout, set the Tile and TileSpan properties on the TiledChartLayoutOptions object. For example, consider a 3-by-3 tiled chart layout. The layout has a grid of tiles in the center, and four tiles along the outer edges. In practice, the grid is invisible and the outer tiles do not take up space until you populate them with axes or charts.

Diagram of a 3-by-3 tiled chart layout.

This code places the chart c in the third tile of the grid.

c.Layout.Tile = 3;

To make the chart span multiple tiles, specify the TileSpan property as a two-element vector. For example, this chart spans 2 rows and 3 columns of tiles.

c.Layout.TileSpan = [2 3];

To place the chart in one of the surrounding tiles, specify the Tile property as "north", "south", "east", or "west". For example, setting the value to "east" places the chart in the tile to the right of the grid.

c.Layout.Tile = "east";

To place the chart into a layout within an app, specify this property as a GridLayoutOptions object. For more information about working with grid layouts in apps, see uigridlayout.

If the chart is not a child of either a tiled chart layout or a grid layout (for example, if it is a child of a figure or panel) then this property is empty and has no effect.

Visibility of object, specified as 'on' or 'off', or as numeric or logical 1 (true) or 0 (false). A value of 'on' is equivalent to true, and 'off' is equivalent to false. Thus, you can use the value of this property as a logical value. The value is stored as an on/off logical value of type matlab.lang.OnOffSwitchState.

  • '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, specified as a Figure, Panel, Tab, TiledChartLayout, or GridLayout 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.

Version History

Introduced in R2019a

expand all