Adding greek character to axis title

前端 未结 6 1004
伪装坚强ぢ
伪装坚强ぢ 2020-11-29 03:37

I want to add a greek character to the y-axis of my barplot in R.
The problem is that I need this character to be integrated in the title. I want to write:



        
6条回答
  •  庸人自扰
    2020-11-29 03:54

    I think I followed your question properly. The ~ forces a space between characters in a call to expression(). Is this what you want?

    plot(1:3, ylab = expression("Diameter of apeture (" * mu ~ "m)"),
      , xlab = expression("Force spaces with ~" ~ mu ~ pi * sigma ~ pi)
      , main = expression("This is another Greek character with space" ~ sigma))
    

    enter image description here

提交回复
热议问题