Adding greek character to axis title

前端 未结 6 1011
伪装坚强ぢ
伪装坚强ぢ 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:45

    I give an updated answer to Chase's plot example (from 2011) above while working with Windows 10 with a suitable TrueType Font with the help package utf8 on R 3.62. In my answer, I assign a value to μ. The unicode characters I just call out by their hex (??) code. The space is just a 'space' inside quotes. See my answer here:

    See also: http://www.unicode.org/Public/10.0.0/ucd/UnicodeData.txt

    utf8-package {utf8}

    # pi small case
    utf8_print("\u03C0")
    "π"
    # sigma small case
    utf8_print("\u03C3")
    "σ"
    
    μ <- abs(digamma(1))
    μseq <- seq(μ,3*μ,μ)
    dev.new()
    plot(μseq, ylab = "Diameter of apeture ( μ m)",
      , xlab = "Force spaces with ~ μ  \u03C0  \u03C3  \u03C0 ",
      , main = "This is another Greek character with space \u03C3")
    #
    

提交回复
热议问题