Trying to write micro symbol in an axis label in matlab in non italics.
21 views (last 30 days)
Show older comments
Roisin Coveney
on 28 Apr 2022
Answered: Walter Roberson
on 28 Apr 2022
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).
0 Comments
Accepted Answer
Walter Roberson
on 28 Apr 2022
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 Comments
More Answers (0)
See Also
Categories
Find more on Labels and Annotations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!