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.
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.
Another possibility is to move the x-axis on top, and bring the title to bottom:
plot(rand(10,1))
h = xlabel(''); pos = get(h,'Position'); delete(h)
h = title('title'); set(h,'Position',pos);
set(gca, 'XAxisLocation','top')
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