Hi,
My axis label is very long and it is in two lines. How can I center the text (for example I want "trajectory angle" to be centered)?
ylabel(['Trajectory angle \newline with respect to vortex axis ( ' char(176), ' )'],'FontSize',axisFont);

 Respuesta aceptada

Star Strider
Star Strider el 7 de Jul. de 2020

2 votos

Try this:
ylabel({'Trajectory angle';'with respect to vortex axis (°)'})
That worked when I tested it.
See the documentation section on: Create Multiline Label for details.
This also works:
ylabel(sprintf('Trajectory angle\nwith respect to vortex axis (°)'))
.

2 comentarios

delmi3
delmi3 el 7 de Jul. de 2020
Thank you. It worked!
Star Strider
Star Strider el 7 de Jul. de 2020
As always, my pleasure!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Preguntada:

el 7 de Jul. de 2020

Comentada:

el 7 de Jul. de 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by