Chemical formula (or mathematical expression) in GNU R plot title

泪湿孤枕 提交于 2019-12-04 16:52:59

You were close. This works:

plot(1:10, main = expression(H[2]*O))

The reason for this is that the 2 is a subscript to element H and you want to position element O next to the H. The notation x * y in an expression means juxtapose x with y, i.e. place x and y together. See ?plotmath for more.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!