我使用以下循环来获取子图:
for j=1:19;
Aj=B(j,:);
subplot(5,4,j);
plot(Aj,h)
end
对于所有这些子图,我只需要一个 x 标签和一个 y 标签。这个怎么做?另外如何将图例插入到所有子图中?
您可以使用suplabel来自文件交换已合并x and y所有子图的标签。
Example:
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');
Output:
Sometimes you have to maximize the figure window to see the xlabel when using suplabel.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)