Avoid plot title superimposing axis
23 次查看(过去 30 天)
显示 更早的评论
When I plot I obtain this:
.
How can I easily avoid the title superimposing the x10^(-3) by placing any of them in a better position? Tried changing the "Position" argument of the function title() (which has the behavior of the function text()) but I don't know how to put it to work properly since I end up putting titles all over the place but not just increasing its height a bit with respect to the plot. I'd really appreciate your help. Thank you!
0 个评论
采纳的回答
Cam Salzberger
2021-11-19
What are you using to position the title so that it comes close to the axes labels there? By default, the title will be center-aligned, so it shouldn't come close. When I use left alignment, the title moves up automatically to get out of the way of the "x10^y":
figure
hAx = axes;
plot(hAx, 10000+rand(10,1))
title(hAx, 'Testing title')
hAx.TitleHorizontalAlignment = 'left';
I guess if it's a really long title, it will get in the way even when center-aligned:
figure
hAx = axes;
plot(hAx, 10000+rand(10,1))
title(hAx, 'Testing really really really really really really really long title')
In that case, you could just make a whitespace sub-title to artificially bump it up. Probably much easier than playing around with position.
figure
hAx = axes;
plot(hAx, 10000+rand(10,1))
title(hAx, 'Testing really really really really really really really long title',' ')
-Cam
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Title 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!