Special characters and superscripts on plot axis titles

后端 未结 2 2179
滥情空心
滥情空心 2020-12-04 16:52

I am trying to make a y-axis title with both a special character and a superscript. I am able to do this, but I want the closing parentheses not to be superscripted. And t

2条回答
  •  心在旅途
    2020-12-04 17:10

    This solves the problem of the super-scripted closing parenthesis:

    # reproducible data
    plates <- data.frame(WatexCl = rnorm(100), ConcuM = rnorm(100), Depth = rnorm(100))
    
    # alter the default plot margins so the 
    # superscript in the y-axis label is completely displayed
    par(mar=c(5,5,4,2))
    
    # draw the plot
    plot(WatexCl ~ ConcuM, data = plates,
         col = as.numeric(1), 
         pch = as.numeric(Depth), 
         xlab = bquote("Concentration Cl ("*mu~"moles/g dry wt)"), 
         ylab = bquote("Average Conc of S- on plates ("~mu~"Moles/cm"^"2"*")"))
    

    enter image description here

提交回复
热议问题