How can i write H2o in the title of a plot?
H2 works:
plot(main=expression("H"[2]),0)
H2O fails:
plot(main=expression("H"[2]"O"),0)
This solution will work only, if i have a space in front ” “
plot(main=expression(" "*H[2]*"O"),0)
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You were close. This works:
The reason for this is that the
2is a subscript to elementHand you want to position elementOnext to theH. The notationx * yin an expression means juxtaposexwithy, i.e. placexandytogether. See?plotmathfor more.