Matlab: change position of ylabel
306 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I was wondering if it is possible to change the position of the ylabel. I would like to move it down (as suggested on the attached figure) to match it better with the yticks.
0 commentaires
Réponses (2)
Ameer Hamza
le 15 Mai 2020
Modifié(e) : Ameer Hamza
le 15 Mai 2020
If you have the handle of ylabel, then you can modify its position using the 'position' property. For example
label_h = ylabel('myLabel');
label_h.Position(1) = 2040; % change horizontal position of ylabel
label_h.Position(2) = 0; % change vertical position of ylabel
Experiment with these values until you get the required location.
2 commentaires
Walter Roberson
le 8 Oct 2022
Recent versions of MATLAB automatically rotate the angle for clarity.
David Hasin
le 8 Oct 2024
You can simply add this to the label line: ", 'Position', [-0.155,0.85,1]"
Here is an example:
ylabel('$\overline U_x/U_o$','FontSize',18,'Interpreter','Latex', 'Position', [-0.155,0.85,1]);
0 commentaires
Voir également
Catégories
En savoir plus sur Axis Labels dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!