Matlab Query: How to align ‘title’ at the botton of the figure when plotting points

MATLABplottitle

My question says everything. I am plotting points on Matlab. But when I set 'title' value, it displays title-name at the top of the image by default. How can I get the title set a the bottom of the image?

Thanks in advance.

Best Answer

If you don't use xlabel you could use that as a quick hack.

If you do use the xlabel, add another line or two by passing a cell array:

figure;
xlabel({'X-label', '', 'Figure title'});

As Amro mentioned in his comments you can make a text anywhere with uicontrol:

x=linspace(0,10*pi);
plot3(x,x.*cos(x),x.*sin(x)); % Plot a 3d spiral
uicontrol('Style','text','Position', [200 20 200 20],'String','My Title')

The positioning is not automatic, so when you resize the figure, the title will move away from the center.