Rotate ylabel with yyaxis left keep centered and space between yticks

14 ビュー (過去 30 日間)
Luis Vallejo Castro
Luis Vallejo Castro 2019 年 11 月 26 日
編集済み: Adam Danz 2023 年 3 月 17 日
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
untitled.png
So, how can I fix it?
THank you

採用された回答

Adam Danz
Adam Danz 2019 年 11 月 26 日
編集済み: Adam Danz 2023 年 3 月 17 日
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 件)

Luis Vallejo Castro
Luis Vallejo Castro 2019 年 11 月 27 日
Thank you!!!

カテゴリ

Help Center および File ExchangeAxis Labels についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by