Sar*_*ama 4 matlab plot subplot matlab-figure
我想给我的子情节提供一个组合标题,而不是单独标题每个情节.例如;
for pl=1:4
subplot(2,2,pl)
title('Test')
end
Run Code Online (Sandbox Code Playgroud)
如果我用这个:
figure
title('Test')
for pl=1:4
subplot(2,2,pl)
end
Run Code Online (Sandbox Code Playgroud)
我没有得到任何头衔.
有一个小技巧.您可以执行以下操作以生成具有多个子图的图形.
h = figure
for pl=1:4
subplot(2,2,pl)
end
Run Code Online (Sandbox Code Playgroud)
在此之后,您必须将NextPlot属性设置为'add'.做这个:
h.NextPlot = 'add';
a = axes;
%// Set the title and get the handle to it
ht = title('Test');
%// Turn the visibility of the axes off
a.Visible = 'off';
%// Turn the visibility of the title on
ht.Visible = 'on';
Run Code Online (Sandbox Code Playgroud)
希望这可以帮助!