Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Matlab 在子批次的情况下,如何为所有x轴和y轴设置通用标签?_Matlab_Matlab Figure_Axis Labels_Axes_Subplot - Fatal编程技术网

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