问题描述
我要在ggplot
的注释的第二行中以斜体显示单个字符
这是情节
iris %>%
ggplot(aes(x = Sepal.Length,y = Species,fill = Species)) +
stat_summary(geom = "bar",fun = "mean") +
theme(legend.position = "none") -> p
现在,我可以像这样注释剧情,并让单个字符变为斜体,而其余字符变为整体。
p + annotate("text",label = "italic(N)==74",x = 3,y = 2,parse = T)
现在说我要粘贴两行注释,并粘贴某些字符。我可以使用plotmath 不用来做到这一点
p + annotate("text",label = paste("AUC = ",round(60.1876,3),"\nN = ",74,sep = ""),size = 4)
如您所见,N
字符已统一。有什么方法可以使它看起来像第二张图,但是使用Plotmath或其他方法将其斜体化为N?