I want to give a combined title to my subplots, instead of titling each plot individually. e.g;
for pl=1:4
subplot(2,2,pl)
title('Test')
end
gives me this:
If I use this:
figure
title('Test')
for pl=1:4
subplot(2,2,pl)
end
I don't get any title.
I want my output like the following:
There is a small trick. You can do the following to spawn a figure with multiple subplots.
h = figure
for pl=1:4
subplot(2,2,pl)
end
After this you have to set the NextPlot
property to 'add'
. Do this:
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';
Hope this helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With