matlab - 如何将颜色栏的字体更改为 latex ?

标签 matlab latex figure colorbar

我有一个带颜色条的 MATLAB 图。我正在尝试将颜色栏刻度线的字体更改为 LateX。这个我试过了,

hBar = colorbar;set(hBar, 'FontName', 'interpreter', 'latex');

但是 MATLAB 给出了这个错误,

“使用 matlab.graphics.illustration.ColorBar/set 时出错 参数/值对参数无效。”

最佳答案

如果您想将刻度标签的解释器更改为 LaTeX,则必须设置 TickLabelInterpreter propertycolorbar :

hBar = colorbar;
set(hBar, 'TickLabelInterpreter', 'latex');

% Or...

colorbar('TickLabelInterpreter', 'latex');

另请注意与字体相关的文档摘录:

The displayed text uses the default LaTeX font style. The FontName, FontWeight, and FontAngle 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/

相关文章:

matlab - matlab 中的符号函数

matlab - 在 3D 空间中拟合椭圆的数据

python - 使用 python Popen 和 pandoc 解析 html 时不需要的新行?

html - 我如何居中图像(图,无形标题)

matlab - 有没有一种有效的方法可以在所有边上用零填充矩阵?

arrays - 具有 max(abs(x),abs(y)) 的元素 x(i) 或 y(i) 的 MATLAB 向量

latex - 将gnuplot与 latex : method and output结合

r - 簇绒 table : convert quartile plots into standard error plots hacking qTable function from NMOF package

html - HTML5图形与img的用法是什么

python - 在 numpy 上绘制 2D 高斯分布