Skip to Main Content Skip to Search
Product Documentation

plotmatrix - Scatter plot matrix

Example of contour function output

Syntax

plotmatrix(X,Y)
plotmatrix(X)
plotmatrix(...,'LineSpec')
[H,AX,BigAx,P] = plotmatrix(...)

Description

plotmatrix(X,Y) scatter plots the columns of X against the columns of Y. If X is p-by-m and Y is p-by-n, plotmatrix produces an n-by-m matrix of axes.

plotmatrix(X) is the same as plotmatrix(X,X), except that the diagonal is replaced by hist(X(:,i)).

plotmatrix(...,'LineSpec') uses a LineSpec to create the scatter plot. The default is '.'.

[H,AX,BigAx,P] = plotmatrix(...) returns a matrix of handles to the objects created in H, a matrix of handles to the individual subaxes in AX, a handle to a big (invisible) axes that frames the subaxes in BigAx, and a matrix of handles for the histogram plots in P. BigAx is left as the current axes so that a subsequent title, xlabel, or ylabel command is centered with respect to the matrix of axes.

Examples

Generate plots of random data.

x = randn(50,3); 
y = x*[-1 2 1;2 0 1;1 -2 3;]';
plotmatrix(y,'*r')

See Also

scatter | scatter3

  


Free MATLAB Interactive Kit

Explore how to use MATLAB to make advancements in engineering and science.


Download free kit

Trials Available

Try the latest version of MATLAB and other MathWorks products.


Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS