Rotate ylabel with yyaxis left keep centered and space between yticks
16 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Luis Vallejo Castro
el 26 de Nov. de 2019
Hello,
I am trying to rotate the ylabel which is place in left y-axis. I use ylabel('C_n^2 (m^{-2/3})','rotation',-90) and it works. However, I also plot the yticks and it overlaps the ylabel with the yticks. Please, see the below picture
So, how can I fix it?
THank you
0 comentarios
Respuesta aceptada
Adam Danz
el 26 de Nov. de 2019
Editada: Adam Danz
el 17 de Mzo. de 2023
Starting in MATLAB R2023a when you change the Rotation property of an axis label in a 2-D plot, the HorizontalAlignment and the VerticalAlignment properties of the label automatically update to prevent overlap between the label and the axes.
Prior to R2023a, you can set the alignment properties as demonstrated below.
ylh = ylabel(. . .);
set(ylh,'rotation',-90,'VerticalAlignment','bottom')
The alignment properties can also be set directly in ylabel(), too.
1 comentario
Más respuestas (1)
Ver también
Categorías
Más información sobre Axis Labels 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!