如何使用TeX在R中绘制粗体文本?
TeX的( “$ \ $阿尔法”)TeX(“1和2的比率为$ \ frac {1} {2} $”)
a< - 1:100plot(a,a ^ 2,xlab = TeX(“$ \ alpha $ bold text”),ylab = TeX(“$ \ alpha ^ 2 $ bold …
library(latex2exp) TeX("$\\alpha$") TeX("The ratio of 1 and 2 is $\\frac{1}{2}$") a <- 1:100 plot(a, a^2, xlab=TeX("$\\alpha$ \\textbf{bold text}"), ylab=TeX("$\\alpha^2$ \\textbf{bold text}"))
你需要在命令前面使用双斜杠,然后你会得到结果: