我想实现一个带有一些子图和顶部的主标题的图形,如下所示:
我使用的代码:
figure
suptitle({'Multi-','line','Title'});
subplot(7,2,1:4);
% there's intentionnal gap between 2 plots
% therefore subplots 5 and 6 aren't used
plot(X);
subplot(7,2,7:14);
plot(Y);
问题是标题的第一行超出了图。
我想实现一个带有一些子图和顶部的主标题的图形,如下所示:
我使用的代码:
figure
suptitle({'Multi-','line','Title'});
subplot(7,2,1:4);
% there's intentionnal gap between 2 plots
% therefore subplots 5 and 6 aren't used
plot(X);
subplot(7,2,7:14);
plot(Y);
问题是标题的第一行超出了图。
文档suptitle
明确指出:
在所有子图命令之后使用此功能。
所以你的解决方案是:
figure
subplot(7,2,1:4);
% there's intentionnal gap between 2 plots
% therefore subplots 5 and 6 aren't used
plot(X);
subplot(7,2,7:14);
plot(Y);
suptitle({'Multi-','line','Title'});