我想编辑情节的标题,使其包含四个单词,只有最后一个是粗体,例如:
标题:“这是”(普通字体)“我的情节”(粗体)。
我尝试了在网上找到的几个代码,但我只设法将绘图的所有标题设为粗体。我的代码(示例)看起来像这样,因为我也想更改颜色和标题的位置。现在,由于我的代码中的“face=bold”,所有标题都是粗体。如上所述,我只希望最后两个单词以粗体显示,但在一行中,因此下面没有副标题或另一行。我正在使用 ggplot2,非常感谢您的帮助!
plot4 <- plot4 + labs(title = "This is my plot")
plot4 <- plot4 + theme(plot.title=element_text(hjust=0.5, vjust=0.1, face='bold', colour="blue"))
Use plotmath
据记录R 文档 https://stat.ethz.ch/R-manual/R-devel/library/grDevices/html/plotmath.html并在ggplot2 维基 https://github.com/tidyverse/ggplot2/wiki/plotmath.
library(ggplot2)
p <- ggplot(iris, aes(Sepal.Length, Sepal.Width, colour = Species)) +
geom_point()
p + labs(title = bquote('This is' ~ bold('my plot')))
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)