R中的部分斜体和粗体文本

时间:2020-06-30 23:07:59

标签: r

我想在R图中将一个亚组标记为非-肠杆菌科

text(-1.5, c(21), pos = 4, c("Non-Enterobacteriaceae"), font = 2, cex = 0.8)

更改字体= 4会将完整单词Non-Enterobacteriaceae更改为 Non-Enterobacteriaceae 有什么建议吗?

1 个答案:

答案 0 :(得分:0)

您可以使用某些?plotmath格式设置选项。例如

plot(c(1,10), c(1,10))
text(5, 5, pos = 4, quote(bold("Non-") * bolditalic("Enterobacteriaceae")), cex = 3)

enter image description here

相关问题