没有开箱即用的解决方案,但这里有一个建议:
clf
for i=1:4
subplot(2,2,i)
plot(1:10,sin(i*(1:10)))
title(sprintf("subplot %d",i))
end
// stretch children axes vertically
alpha=0.91;
for ax=gcf().children'
ax.axes_bounds(2)=1+alpha*(ax.axes_bounds(2)-1)
ax.axes_bounds(4)=ax.axes_bounds(4)*alpha
end
// create new axes above and create title text
h=newaxes();
h.axes_bounds=[0 0 1 1-alpha];
xstringb(0,0,"This is an overall title",1,0.1)
gce().font_size=3