MATLAB: How to give labels and title to all subplot one time

subplot

I am having 12 subplots in my figure All are required to have same labels How can i give them label by mentioning only one time?

Best Answer

One may use FINDOBJ to locate all subplots/axes on a figure and then use a FOR loop to label/title all the subplots. For example:
f=figure;
subplot(2,2,1:2)
text(.5,.5,'subplot(2,2,1:2)',...
'FontSize',14,'HorizontalAlignment','center')
subplot(2,2,3)
text(.5,.5,'subplot(2,2,3)',...
'FontSize',14,'HorizontalAlignment','center')
subplot(2,2,4)
text(.5,.5,'subplot(2,2,4)',...
'FontSize',14,'HorizontalAlignment','center')
ax = findobj(f,'Type','Axes');
for i=1:length(ax)
ylabel(ax(i),{'Nice'})
title(ax(i),{'Very Nice'})
end
Hope this helps.
Abhi...
Related Question