Why is "Helvetica" the default axes font type in MATLAB when this font does not exist on my Windows XP machine?
92 次查看(过去 30 天)
显示 更早的评论
When I create text on an axis of a figure in MATLAB, the font type of the text is "Helvetica" but this font does not exist on my machine.
plot(1:10)
xlabel('Text');
get(gca, 'FontName')
If I print this figure to an EPS-file, and use the figure in another application, I receive an error that the font is not found.
采纳的回答
MathWorks Support Team
2018-2-7
编辑:MathWorks Support Team
2018-2-7
Axes text which use the default font type in MATLAB may not be visible when exporting MATLAB graphics to other applications, if the 'Helvetica' font is not available on the system.
To work around this issue, change the default font by executing the following command:
set(0,'defaultAxesFontName', '<fontname>')
set(0,'defaultTextFontName', '<fontname>')
where '<fontname>' is the name of the font you wish to use, e.g. 'Arial'.
You may include this statement in your startup.m file to ensure that it is executed in every MATLAB session. For more information on creating a startup.m file, execute the following command in the MATLAB Command Window:
doc startup
If you print a figure in MATLAB, the fonts supported for printing depend upon the MATLAB printer driver you specify and sometimes upon which platform you are using. For further information, refer to the following documentation on Font Support:
1 个评论
Bryan
2019-11-22
I have the same problem. The fonts appear in the figure window but disappear when doing the following two things. (1) Saving using -painters (2) Using a special character with char()
Happens in Linux, but not in Windows
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Labels and Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!