How to italicize part (one or two words) of an axis title

好久不见. 提交于 2019-11-28 08:54:35

You could make an expression like this:

my_y_title <- expression(paste("No. of ", italic("bacteria X"), " isolates with corresponding types"))
.... + labs(y=my_y_title)

I believe RFelber's suggestion is what you are after. Try this:

labs(x="Groups",y=expression('No. of'~italic(bacteria X)~'isolates with corresponding types'),fill="Var1")

I did not need to use the bquote() function. The tildes produce single spaces for terms that are outside of the quotes.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!