Why is "Helvetica" the default axes font type in MATLAB when this font does not exist on my Windows XP machine?

144 次查看(过去 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.
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
编辑: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:
  3 个评论
Himanshu Saxena
Himanshu Saxena 2022-3-2
After setting the default fontname as "Arial" using the command "set(0,'defaultAxesFontName','Arial')", the "print(gcf,'filename','-dpng','-r600')" command does not follow the Arial font in the title and colorbar label of the resulting image.
How one can set the "Arial" font for every text type in the graphic plots?


更多回答(0 个)




Community Treasure Hunt

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

Start Hunting!

Translated by