1

在基础 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)))

衬线

仍然不完美,但更接近。

  • 如果我希望文本为sans,是否可以更改符号的字体系列中间句?
  • 如果没有,有没有更好的方法来排版 μg in plot
4

1 回答 1

0

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

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

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

μ

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

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

于 2021-04-08T13:21:38.333 回答