rggplot2expression

Expression function


I want to add a new line after ratio "Intercellular/ambient CO2" and C[i]/C[a] should come in second line using expression() function any suggestions i am using following code

expression(bold(Intercellualr/ambient~CO[2]~ratio \n (C[i]/C[a])))

Solution

  • Use atop like this:

    hdg <- ~ bold(atop(Intercellualr/ambient~CO[2]~ratio, C[i]/C[a]))
    plot(0, main = hdg)
    

    screenshot