Matlab 在子批次的情况下,如何为所有x轴和y轴设置通用标签?
我使用了以下循环来获取子图:Matlab 在子批次的情况下,如何为所有x轴和y轴设置通用标签?,matlab,matlab-figure,axis-labels,axes,subplot,Matlab,Matlab Figure,Axis Labels,Axes,Subplot,我使用了以下循环来获取子图: for j=1:19; Aj=B(j,:); subplot(5,4,j); plot(Aj,h) end 对于所有这些子批次,我只需要一个x标签和一个y标签。如何做到这一点?另外,如何将图例插入所有子批次?您可以使用FileExchange为所有子批次组合x和y标签 示例: subplot(1,2,1); plot(randperm(40)); hold on; plot(randperm(40)); %Plotting some ra
for j=1:19;
Aj=B(j,:);
subplot(5,4,j);
plot(Aj,h)
end
对于所有这些子批次,我只需要一个x标签和一个y标签。如何做到这一点?另外,如何将图例插入所有子批次?您可以使用FileExchange为所有子批次组合x和y标签
示例:
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');
输出:
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');
有时,在使用时,您必须最大化figure窗口以查看xlabel