Setting default Figure font, different from Desktop

39 次查看(过去 30 天)
I'm trying to set the default figure font independent of the desktop font, however this doesn't seem to be possible in the 'preferences' section. Is it possible to set the desktop font to Helvetica, while setting the default figure fonts to Arial?

回答(1 个)

Daniel Shub
Daniel Shub 2013-3-11
There is a nice blog post about this over at undocumentedmatlab. Basically you do
set(0, 'DefaultAxesFontName', 'Arial');
set(0, 'DefaultTextFontName', 'Arial');
You can add this to your startup.m, but it is a little dangerous. I would suggest limiting the effects to a single figure at a time.
figure;
set(gcf, 'DefaultAxesFontName', 'Arial');
set(gcf, 'DefaultTextFontName', 'Arial');
You could create your own function
function h = arialfigure
h = figure;
set(h, 'DefaultAxesFontName', 'Arial');
set(h, 'DefaultTextFontName', 'Arial');
end

类别

Help CenterFile Exchange 中查找有关 Interactive Control and Callbacks 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by