Is it possible to display unicode in MATLAB plot labels?

前端 未结 3 1760
猫巷女王i
猫巷女王i 2020-12-11 16:15

I would like to call something like

xlabel( \'Time (μs)\' );  

But that just shows up with a question mark on the plot. Is there anyway t

3条回答
  •  时光取名叫无心
    2020-12-11 16:30

    For your specific example, you can get the display you want using TeX\LaTeX formatting:

    xlabel('Time ({\mu}s)');
    

    For the more general case of displaying Unicode characters, if you know the code for your character you can convert the decimal value for the code to a character using the function char and build a string like so:

    xlabel(['Time (' char(181) 's)']);  % Same results as above
    

提交回复
热议问题