Main Content

PlotMatrix

散点图矩阵

  • 散点图矩阵

Description

例子

plotmatrix(X,,,,y创建一个子轴的矩阵,其中包含列的散点图Xagainst the columns ofy。IfXp-by-nyp-by-m, 然后PlotMatrix产生一个n-by-m亚轴的矩阵。

例子

plotmatrix(X是相同的plotmatrix(X,,,,X)除了沿对角线的亚轴替换为在相应列的数据的直方图取代X。例如,沿对角线的亚轴一世该列被取代直方图(x(:,i))

例子

plotmatrix(___,,,,LineSpecspecifies the line style, marker symbol, and color for the scatter plots. The optionLineSpec可以先于先前语法中的任何输入参数组合。

例子

plotmatrix(斧头,,,,___绘制到指定的目标轴,其中目标轴是亚轴的无形框架。

例子

[[s,,,,斧头,,,,BigAx,,,,H,,,,HAx] = plotmatrix(___返回创建的图形对象如下:

  • s- 散点图的图表线对象

  • 斧头– Axes objects for each subaxes

  • BigAx– Axes object for big axes that frames the subaxes

  • H- 直方图的直方图对象

  • HAx– Axes objects for the invisible histogram axes

BigAx是left as the current axes (gca)so that a subsequent标题,,,,xlabel, 或者ylabel指挥中心关于大轴的文字。

Examples

全部收缩

创造X作为随机数据的矩阵,y作为整数值的矩阵。然后,创建一个列的散点图矩阵Xagainst the columns ofy

x = randn(50,3);y= reshape(1:150,50,3); plotmatrix(X,Y)

MATLAB figure

ITH行中的子图,图的jth列是ITH列的散点图y违反X

创建一个随机数据的散点图矩阵。这subplot in the ith row, jth column of the matrix is a scatter plot of the ith column ofX违反X。沿对角线是每一列的直方图X

x = randn(50,3);plotmatrix(X)

MATLAB figure

创建一个随机数据的散点图矩阵。指定标记类型和散点图的颜色。

x = randn(50,3);plotmatrix(X,,,,'*r'

MATLAB figure

LineSpecoption sets properties for the scatter plots. To set properties for the histogram plots, return the histogram objects.

创建一个随机数据的散点图矩阵。

RNG默认x = randn(50,3);[S,AX,BIGAX,H,HAX] = PlotMatrix(X);

MATLAB figure

要设置散点图的属性,请使用s。To set properties for the histograms, useH。To set axes properties, use斧头,,,,BigAx, 和HAx。Use dot notation to set properties.

在图的左下角设置散点图的颜色和标记类型。在右下角设置直方图图的颜色。使用标题命令标题为图。

S(3).Color ='g'; S(3).Marker ='*'; H(3).EdgeColor ='k'; H(3).FaceColor ='g'; title(BigAx,'A Comparison of Data Sets'

MATLAB figure

输入参数

全部收缩

显示的数据,指定为矩阵。

Data Types:|double|int8|一世nt16|一世nt32|一世nt64|uint8|uint16|uint32|Uint64|逻辑

Data to plot againstX,指定为矩阵。

Data Types:|double|int8|一世nt16|一世nt32|一世nt64|uint8|uint16|uint32|Uint64|逻辑

线风格,标记,和颜色,指定为a character vector or string containing symbols. The symbols can appear in any order. You do not need to specify all three characteristics (line style, marker, and color). For example, if you omit the line style and specify the marker, then the plot shows only the marker and no line.

Example:' - 或者'是a red dashed line with circle markers

线样式 Description Resulting Line
' - ' solid line

sample of solid line

' - ' 虚线

虚线样品

':' 虚线

虚线样品

' - 。' 破折号线

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

标记 Description 结果标记
'o' 圆圈

圆形标记样品

'+' Plus sign

sample of plus sign marker

'*' 星号

sample of asterisk marker

'。' 观点

点标记样本

'X' Cross

sample of cross marker

'_' Horizontal line

sample of horizontal line marker

'|' Vertical line

垂直线标记样品

' 正方形

sample of square marker

'd' 钻石

钻石线标记样品

'^' 向上的三角形

sample of upward-pointing triangle marker

'v' Downward-pointing triangle

sample of downward-pointing triangle marker

'>' 右点三角形

右点三角形标记的样本

'<' Left-pointing triangle

左点三角形标记的样本

'P' Pentagram

sample of pentagram marker

'h' hexagram

六边形标记样品

颜色名称 short Name RGB三胞胎 外貌
'红色的' 'r' [1 0 0]

sample of the color red

'绿色' 'g' [[0 1 0]

sample of the color green

'blue' 'b' [[0 0 1]

蓝色样品

'青色' 'c' [[0 1 1]

sample of the color cyan

'magenta' 'm' [1 0 1]

颜色洋红色样品

'yellow' 'y' [1 1 0]

sample of the color yellow

'black' 'k' [[0 0 0]

颜色黑色样品

'白色的' 'W' [1 1 1]

颜色样品白色

Target axes that frames all the subaxes, specified as anAxes目的。如果您不指定此参数,则PlotMatrixuses the current axes.

Output Arguments

全部收缩

Chart line objects for the scatter plots, returned as a matrix. These are unique identifiers, which you can use to query and modify the properties of a specific scatter plot.

轴对象的子轴,返回为矩阵。这些是唯一的标识符,您可以使用它们来查询和修改特定子轴的属性。

Axes object for big axes, returned as a scalar. This is a unique identifier, which you can use to query and modify properties of the big axes.

H一世stogram objects, returned as a vector or[]。这se are unique identifiers, which you can use to query and modify the properties of a specific histogram object. If no histogram plots are created, thenH是returned as empty brackets.

笔记

starting in R2015b,H是a vector of histogram objects, In previous releases, it was a vector of patch objects.

无形直方图轴的轴对象,以向量或向量返回[]。这se are unique identifiers, which you can use to query and modify the properties of a specific axes. If no histogram plots are created, thenHAx是returned as empty brackets.

Extended Capabilities

版本历史记录

在R2006a之前引入