I have created a simple polar plot like this:
polar(direction, power, 'k.')
title('this is my title')
Only the title overlaps the numbers at the top of the circle.
How do I shift the plot down / title up or create room to do so? I would have thought MATLAB would adjust itself automatically?
You can modify the call to title so that it returns a handle, which you can then use to adjust the position.
t = title('this is my title');
get(t,'Position')
ans =
-0.0024 1.1810 1.0001
set(t,'Position',get(t,'Position')+[0 .01 0]); % move up slightly
The default position of the title is expressed as a fraction relative to the current plot axes, which are based on the figure window size. So you may see overlap if the window is small. Enlarging the window may solve the problem for you without the need for doing anything else.
You can also shift the plot around by adjusting its Position -- but since the title's position is fixed to the plot axes, the title will just shift with the plot. But this can be useful with the solution above if the space above the plot is crowded.
get(gca,'Position')
ans =
0.1300 0.1100 0.7750 0.8150
set(gca,'Position',[.13,.10,.775,.815]); % move plot down a bit
For what it is worth, you can also place text in an arbitrary position using the 'text' command.
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