Trying to write micro symbol in an axis label in matlab in non italics.

21 ビュー (過去 30 日間)
Roisin Coveney
Roisin Coveney 2022 年 4 月 28 日
回答済み: Walter Roberson 2022 年 4 月 28 日
I want to make an axis label of x (μm) and have been trying to use the following commands,
ylabel('$x$ (\mu m)', 'interpreter', 'latex')
ylabel('$x$ (μm)', 'interpreter', 'latex')
but for each I get the following error,
String scalar or character vector must have valid interpreter syntax:
$x$ (\mu m).

採用された回答

Walter Roberson
Walter Roberson 2022 年 4 月 28 日
That is not supported in latex without the equivalent of amsfont package. Math mode always italicizes the greek letters unless you pull in another font, and MATLAB does not support mixing math mode and non-math mode.
However if you use tex instead of latex then the μ unicode character is supported, and perhaps you could manually tell it to switch to italic for the x

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLabels and Annotations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by