2015-04-05 59 views
0

有没有办法在plotmatrix函数的图之间添加一些空格? (我想标注每个xy轴)在plotmatrix函数的图之间添加空格

+0

如果每个轴得到的不同的标签,是你确定你想要'plotmatrix '而不是'subplot'? – Daniel 2015-04-05 21:20:30

回答

1

您可以通过在plotmatrix的调用中使用特定的输出参数来实现。然后,您可以检索每个轴的位置并对其进行修改(使其更小)。

例子:

clc 
clear 

rng default 
X = randn(50,3); 
Y = reshape(1:150,50,3); 

%// Use this output argument 
[~,AX,~,~,~] = plotmatrix(X,Y); 

%// Fetch all the positions and alter them (make axes smaller) 
AllPos = get(AX(:),'Position'); 

AllPos = vertcat(AllPos{:}); 

NewPos = [AllPos(:,1)+.05 AllPos(:,2)+.05 AllPos(:,3)-.1 AllPos(:,4)-.1] 

%// Update the plot 
for k = 1:numel(AX) 
    axes(AX(k)) 

    set(AX(k),'Position',NewPos(k,:)) 

    xlabel(sprintf('Axes %i',k)) 

end 

输出如下:

enter image description here

相较于原来的情节:

enter image description here

+0

再次感谢您的帮助,我真的很熟悉它。 – mat 2015-04-14 22:20:14

+0

太好了,非常欢迎!你的问题非常有趣:) – 2015-04-14 22:22:30

相关问题