Use "bquote" in ggplot2 for subscript text

Hi there I would like to add a y-axis label that contains a lot of sub/superscript expressions.
I use "bquote" to do this.
I am able to almost produce what I want by using the following code:

 ylab(bquote("Vc[max] ("*mu~ "mol" ~CO[2]~ m^-2~s^-1*")"))+

Unfortunately, however, I am not able to make "max" become a subscript (i.e. Vc should be normally written and "max" should be a subscript expression right next to Vc). Can anybody help me with this? Thank you very much!
Mike
Unbenannt

This seems to work:

library(ggplot2)
DF <- data.frame(A = 1:4, B = 2:5)
ggplot(DF, aes(A, B)) + geom_point() + 
  ylab(bquote(Vc[max](mu~mol ~CO[2]~ m^-2~s^-1)))

Created on 2019-09-26 by the reprex package (v0.2.1)

1 Like

Dear FJCC:
Thank you so much. Your solution works perfect! You made my day!
Mike

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.