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

前端 未结 3 645
情深已故
情深已故 2020-12-03 09:31

Is there any way to change the style of part of an axis title while keep the rest part unchanged? In my case, How could I italicize
\"bacteria X\" in the y-axis title? T

3条回答
  •  醉梦人生
    2020-12-03 10:13

    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.

提交回复
热议问题