Write part of xlabel in LaTeX (not whole label)

53 ビュー (過去 30 日間)
Minas Emiris
Minas Emiris 2020 年 5 月 10 日
回答済み: HC J 2023 年 12 月 29 日
Hi all,
I am aware that using something like:
xlabel('X-label, $x_{label,LaTeX}$ (W)','Interpreter','latex')
can help to write in LaTeX, however, I was wondering if there's any way I can use LaTeX for only and write the remaining part of the label in the default font of the MATLAB label - I've seen that the LaTeX interpreter doesn't allow changing font?

採用された回答

Payas Bahade
Payas Bahade 2020 年 5 月 19 日
Hi Minas,
To have part of xlabel in regular MATLAB figure font and remaining in LaTeX font, you can specify font for specific parts inside LaTeX markup as follows:
xlabel('$\textsf{X-Label} \: x_{label,LaTeX} \textsf{(W)}$','Interpreter','latex')
Hope this helps!
  1 件のコメント
Minas Emiris
Minas Emiris 2020 年 5 月 19 日
Very helpful. Thanks!

サインインしてコメントする。

その他の回答 (1 件)

HC J
HC J 2023 年 12 月 29 日
我也遇到了相同的问题,不知道哪里出错,各种尝试了一下:
  1. 作者的办法是可以用的;
  2. sf会出错
  3. bf加粗

カテゴリ

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