Avoid plot title superimposing axis
22 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Turing Machine
el 19 de Nov. de 2021
Comentada: Turing Machine
el 20 de Nov. de 2021
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 comentarios
Respuesta aceptada
Cam Salzberger
el 19 de Nov. de 2021
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
Más respuestas (0)
Ver también
Categorías
Más información sobre Title en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!