PlotMatrix
散点图矩阵
句法
Description
plotmatrix(___,,,,
specifies the line style, marker symbol, and color for the scatter plots. The optionLineSpec
)LineSpec
可以先于先前语法中的任何输入参数组合。
[[
返回创建的图形对象如下:s
,,,,斧头
,,,,BigAx
,,,,H
,,,,HAx
] = plotmatrix(___)
s
- 散点图的图表线对象斧头
– Axes objects for each subaxesBigAx
– Axes object for big axes that frames the subaxesH
- 直方图的直方图对象HAx
– Axes objects for the invisible histogram axes
BigAx
是left as the current axes (gca
)so that a subsequent标题
,,,,xlabel
, 或者ylabel
指挥中心关于大轴的文字。
Examples
创造scatter Plot Matrix with Two Matrix Inputs
创造X
作为随机数据的矩阵,y
作为整数值的矩阵。然后,创建一个列的散点图矩阵X
against the columns ofy
。
x = randn(50,3);y= reshape(1:150,50,3); plotmatrix(X,Y)
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)
指定标记类型和颜色
创建一个随机数据的散点图矩阵。指定标记类型和散点图的颜色。
x = randn(50,3);plotmatrix(X,,,,'*r')
这LineSpec
option 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);
要设置散点图的属性,请使用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')
输入参数
X
-要显示的数据
矩阵
显示的数据,指定为矩阵。
Data Types:单
|double
|int8
|一世nt16
|一世nt32
|一世nt64
|uint8
|uint16
|uint32
|Uint64
|逻辑
y
-Data to plot againstX
矩阵
Data to plot againstX
,指定为矩阵。
Data Types:单
|double
|int8
|一世nt16
|一世nt32
|一世nt64
|uint8
|uint16
|uint32
|Uint64
|逻辑
LineSpec
-线样式,标记和颜色
character vector|string
线风格,标记,和颜色,指定为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 |
|
' - ' |
虚线 |
|
':' |
虚线 |
|
' - 。' |
破折号线 |
|
标记 | Description | 结果标记 |
---|---|---|
'o' |
圆圈 |
|
'+' |
Plus sign |
|
'*' |
星号 |
|
'。' |
观点 |
|
'X' |
Cross |
|
'_' |
Horizontal line |
|
'|' |
Vertical line |
|
' |
正方形 |
|
'd' |
钻石 |
|
'^' |
向上的三角形 |
|
'v' |
Downward-pointing triangle |
|
'>' |
右点三角形 |
|
'<' |
Left-pointing triangle |
|
'P' |
Pentagram |
|
'h' |
hexagram |
|
颜色名称 | short Name | RGB三胞胎 | 外貌 |
---|---|---|---|
'红色的' |
'r' |
[1 0 0] |
|
'绿色' |
'g' |
[[0 1 0] |
|
'blue' |
'b' |
[[0 0 1] |
|
'青色' |
'c' |
[[0 1 1] |
|
'magenta' |
'm' |
[1 0 1] |
|
'yellow' |
'y' |
[1 1 0] |
|
'black' |
'k' |
[[0 0 0] |
|
'白色的' |
'W' |
[1 1 1] |
|
斧头
-Target axes
Axes
目的
Target axes that frames all the subaxes, specified as anAxes
目的。如果您不指定此参数,则PlotMatrix
uses the current axes.
Output Arguments
s
-Chart line objects for scatter plots
矩阵
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.
斧头
- 亚轴的轴对象
矩阵
轴对象的子轴,返回为矩阵。这些是唯一的标识符,您可以使用它们来查询和修改特定子轴的属性。
BigAx
- 大轴的轴对象
标量
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
- 直方图对象
向量|[]
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.
HAx
-Axes objects for invisible histogram axes
向量|[]
无形直方图轴的轴对象,以向量或向量返回[]
。这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
GPU Arrays
使用并行计算工具箱™在图形处理单元(GPU)上运行加速代码。
Usage notes and limitations:
此功能接受GPU数组,但不在GPU上运行。
For more information, see在GPU上运行MATLAB功能(Parallel Computing Toolbox)。
分布式阵列
使用Parallel Computing Toolbox™,将群集组合内存的组合存储器划分。
Usage notes and limitations:
此函数在分布式数组上运行,但在客户端MATLAB中执行®。
For more information, see运行具有分布式数组的MATLAB功能(Parallel Computing Toolbox)。
版本历史记录
也可以看看
Open Example
you have a modified version of this example. Do you want to open this example with your edits?
MATLAB Command
您单击了与此MATLAB命令相对应的链接:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
选择一个网站
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select:。
您还可以从以下列表中选择一个网站:
How to Get Best Site Performance
选择中国网站(中文或英语)以获得最佳场地性能。其他Mathworks乡村网站未针对您所在的访问进行优化。
美洲
- América Latina(Español)
- 加拿大(English)
- 美国(English)
欧洲
- Netherlands(English)
- 挪威(English)
- Österreich(德意志)
- 葡萄牙(English)
- 瑞典(English)
- 瑞士
- United Kingdom(English)