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

19 visualizaciones (últimos 30 días)
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).

Respuesta aceptada

Walter Roberson
Walter Roberson el 28 de Abr. de 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

Más respuestas (0)

Categorías

Más información sobre Labels and Annotations en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by