I would like to have the units on the axis from a Matlab plot with the correct form like SIunitx in LATEX. Is this possible?
This is the line that I would like to have different: no u, but μ.
xlabel('C [uF]', 'fontsize', 20,'Interpreter','latex')
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.Sign up to join this community
You may need matlab2tikz: https://github.com/matlab2tikz/matlab2tikz
This is a plug-in using tikz, output tikz code from matlab, and modify symbols from the code, with latex compilation
Short answer: Just write
\mu in your
xlabel. Matlab can understand some TeX syntax, see https://se.mathworks.com/help/matlab/ref/text.html#f68-481090_sep_shared-Interpreter (though this does not mean it actually uses TeX).
Addition: as you will see from the Matlab documentation, you can make Matlab use LaTeX to typeset text, with the
'Interpreter', 'LaTeX' option. I've never really used this feature much, and don't really know any details about it. It appears that in earlier versions of Matlab it was possible to add packages to the preamble used, but that changed around 2016 (https://se.mathworks.com/matlabcentral/answers/368641-add-more-latex-packages-for-latex-interpreter-in-matlab#comment_507908). Hence it's not possible to use e.g.
siunitx in Matlab.
After endless searching on the internet, I didn't find a nice-looking answer, either. Nobody wants a math-italic-µ, followed by a "m" after some space, so it looks like µ m. Then, I asked myself "Why don't you try ASCII characters?" I looked up "µ" on the internet, copied it, pasted it into the plot label/title/etc. of Matlab and was done. It works and looks fine. No awkward font, just the usual one. Should work with all Greek letters.