有一个小技巧。你可以按照以下方式生成带有多个子图的图形。
h = figure
for pl=1:4
subplot(2,2,pl)
end
接下来,您需要将 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';
clear all
close all
clc
name={'first', 'second', 'third', 'fourth'};
for k = 1:4
subplot(2,2,k);
title(name(k));
end
希望这可以帮助到您。最好的祝愿。
suplabel
提交:http://www.mathworks.com/matlabcentral/fileexchange/7772-suplabel - rayryeng