我有一个带颜色条的 MATLAB 图。我正在尝试将颜色栏刻度线的字体更改为 LateX。这个我试过了,
hBar = colorbar;set(hBar, 'FontName', 'interpreter', 'latex');
但是 MATLAB 给出了这个错误,
“使用 matlab.graphics.illustration.ColorBar/set 时出错 参数/值对参数无效。”
最佳答案
如果您想将刻度标签的解释器更改为 LaTeX,则必须设置 TickLabelInterpreter
property的 colorbar :
hBar = colorbar;
set(hBar, 'TickLabelInterpreter', 'latex');
% Or...
colorbar('TickLabelInterpreter', 'latex');
另请注意与字体相关的文档摘录:
The displayed text uses the default LaTeX font style. The
FontName
,FontWeight
, andFontAngle
properties do not have an effect. To change the font style, use LaTeX markup within the text.
关于matlab - 如何将颜色栏的字体更改为 latex ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53713213/