How do you enable "special" characters like "é" on figures?
Mostrar comentarios más antiguos
I have to write elements like plot titles in french and those characters show up as blanks.
Simple example:
fplot(@(x) x^2, [0 5]);
title('éééé')
Respuestas (1)
Star Strider
el 9 de Nov. de 2015
0 votos
You will probably have to use the LaTeX interpreter. See Text with Mathematical Expression Using LaTeX for details on calling it in MATLAB, and the LaTeX site for details on how to enter characters for various alphabets.
3 comentarios
Julien Gougeon
el 9 de Nov. de 2015
Star Strider
el 9 de Nov. de 2015
I just tried it on my machine with a plot I just created, and it works perfectly, as your code did previously. See if char(0233) prints correctly.
My (too obvious) suggestion otherwise is to re-start MATLAB. If you are still having problems after that, contact MathWorks Tech Support.
I have seen discussions on getting Unicode characters to print, but 'é' is part of the ASCII character set, and you should have no problems with it.
Walter Roberson
el 10 de Nov. de 2015
Star Strider, ASCII ends at position 127 (or 126 depending on which ASCII you are looking at), but 'é' is beyond that at 233. 'é' is defined by a number of character sets, including the common ISO-8896-1, though you need ISO-8896-15 or ISO-8896-16 for complete support for French.
Support for characters in the range 128 to 255 in plots has existed for a number of years; I do not know when it first started. But you do need to be using a Font that supports the characters. If you have not explicitly specified the Font to use then there is a possibility that you are inheriting a default font; check
get(0, 'factoryTextFontName')
and so on for 'factoryUicontrolFontName', 'factoryUitableFontName', 'factoryAxesFontName', 'factoryTextFontName', 'factoryUipanelFontName'
Categorías
Más información sobre Annotations en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!