1
我用下面的循环得到的次要情节:如何在子图上使用所有x和y轴的通用标签?
for j=1:19;
Aj=B(j,:);
subplot(5,4,j);
plot(Aj,h)
end
对于所有这些次要情节,我需要只有一条X标签和一个Y标签。这个怎么做?还有如何将图例插入到所有子图中?
我用下面的循环得到的次要情节:如何在子图上使用所有x和y轴的通用标签?
for j=1:19;
Aj=B(j,:);
subplot(5,4,j);
plot(Aj,h)
end
对于所有这些次要情节,我需要只有一条X标签和一个Y标签。这个怎么做?还有如何将图例插入到所有子图中?
您可以使用suplabel
从FileExchange已经合并X和ÿ标签的所有次要情节。
例子:
subplot(1,2,1);
plot(randperm(40)); hold on; plot(randperm(40)); %Plotting some random data
legend('show') %To show the legend
subplot(1,2,2);
plot(randperm(40)); hold on; plot(randperm(40)); %Plotting some random data
legend('show') %To show the legend
%Using suplabel from the FileExchange to give a single x and y label for all subplots
suplabel('Combined X label','x');
suplabel('Combined Y label','y');
输出:
有时你必须最大限度的身影窗口看到xlabel当我们ing suplabel
。