首页 > 解决方案 > plotmath 中的 μ 符号排版不良

问题描述

在基础 R 中使用默认字体 ( sans) 时,像 μ 这样的符号排版效果不佳:

plot(1, xlab = bquote("I want sans font here, but serif font for:" ~ (mu * g)))

无

g看起来比μ符号大。

将字体系列设置为serif稍微改善了这一点:

par(family = "serif)
plot(1, xlab = bquote("I want sans font here, but serif font for:" ~ (mu * g)))

衬线

仍然不完美,但更接近。

标签: rplotfontsplotmathtypesetting

解决方案


如果没有,有没有更好的方法来排版 μgplot

事实证明,确实有一种更简单的方法来获得更好的排版符号:

plot(1, xlab = "It turns out you can just use the character μ directly")

μ

如果您使用正确的编码(这里我使用 UTF-8)保存,许多符号可以直接在 R 代码中使用,并且可以正确打印。

我希望这个答案对其他人有用。


推荐阅读