|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
%% =======散点图scatter , scatter3 , plotmatrix======
%scatter3(X,Y,Z,S,C):在由向量X、Y和Z指定的位置显示大小和颜色分别由S和C决定的离散点
figure;
[x,y,z] = sphere(16);
X = [x(:)*.5 x(:)*.75 x(:)];
Y = [y(:)*.5 y(:)*.75 y(:)];
Z = [z(:)*.5 z(:)*.75 z(:)];
S = repmat([10 2 5]*10,numel(x),1);
C = repmat([1 2 3],numel(x),1);
subplot(1,2,1);
scatter(X(:),Y(:),S(:),C(:));
title('scatter');
subplot(1,2,2);
scatter3(X(:),Y(:),Z(:),S(:),C(:),'filled'), view(-60,60);
title('scatter3');
%plotmatrix(X,Y)绘出X(p*M)与Y(p*N)的列组成的散度图(N,M)
figure;
X=randn(100,2);Y=randn(100,2);
subplot(1,3,1),plotmatrix(X);%等价于plotmatrix(X,X),除了对角上的图为X每一列的直方图hist(X(:,col))
title('plotmatrix(X)');
subplot(1,3,2),plotmatrix(X,X);
title('plotmatrix(X,X)');
subplot(1,3,3),plotmatrix(X,Y);
title('plotmatrix(X,Y)');
|