Adjust subscript style / height
37 ビュー (過去 30 日間)
古いコメントを表示
Sebastian Sprunck
2019 年 10 月 5 日
コメント済み: Sebastian Lopez
2024 年 8 月 6 日
Hi all,
I'm trying to get 'neat' subscripts in the axes labels of a plot. I'd like to use the standard tex interpreter, as most of my figures are already using it, but the subscript style doesn't look good IMO:
I'd like the subscripted 'n' to not be completely below the 't' but rather have its upper end somewhere close to the t's middle.
Changing the interpreter to latex does exactly what I want, but it changes the font not only of the characters in question, but of the whole axis label as well as putting it in cursive:
Is there any way to adjust the subscript's height with the tex interpreter?
Best regards
Sebastian
採用された回答
Manuela Cabrera
2020 年 9 月 26 日
Hi sebastian
I hope this is still useful. I use diffenrent text heights in the same label sing this code:
ylabel(['\fontsize{12} Normalized strength (F\fontsize{10} R\fontsize{12} /F\fontsize{10} Rmax \fontsize{12})'],'fontweight','bold')
1 件のコメント
Sebastian Lopez
2024 年 8 月 6 日
This worked like a charm. Four years later another Sebastian thanks...
その他の回答 (2 件)
wang
2021 年 4 月 7 日
You can get roman or italic using \mathrm{} or \mathit{} respectively. And you can use both \mathrm{} and \mathit{} to get the effect of both regular and italic
figure
text(0.1,0.5,'$\mathrm{A_n}$','FontSize',16,'Interpreter','latex')
text(0.2,0.5,'$\mathit{A_n}$','FontSize',16,'Interpreter','latex')
text(0.3,0.5,'$\mathrm{A} \mathit{_n}$','FontSize',16,'Interpreter','latex')
0 件のコメント
Muhammad Usman
2019 年 10 月 6 日
use the following after the plot command
xlabel("y_{" + n + "}", 'Interpreter', 'tex') %for alphabet
and
xlabel(" \Omega_{" + n + "}", 'Interpreter', 'tex') %for special charcters
more more details please have look to this link:
参考
カテゴリ
Help Center および File Exchange で Labels and Annotations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!