[R] isotope superscripts ggplot2

Brian Diggs diggsb at ohsu.edu
Fri Sep 30 21:08:07 CEST 2011

On 9/30/2011 8:31 AM, Durant, James T. (ATSDR/DTEM/PRMSB) wrote:
> Happy Friday fellow R users.
> I need some help - I am trying to make a graph using ggplot 2 of some lead isotope ratios. Normally, the isotope mass number appears as a  superscript before the chemical symbol. However, I cannot figure out how to do this ggplot2's axis labels. The closest I have come is using "." In front of the numbers I am superscripting e.g:
> ggplot(.... +xlab(expression(.^207*"Pb/"*.^206*"Pb"))+ylab(expression(.^208*"Pb/"*.^206*"Pb")
> I have searched for this and have not had any luck so far... any suggestions?

You can replace the . with phantom("")  This will give the ^ something 
to be an exponent of (namely, a non-printed blank).

> VR
> Jim
> James T. Durant, MSPH, CIH
> Emergency Response Coordinator
> DIvision of Toxicology and Environmental Medicine
> US Agency for Toxic Substances and Disease Registy
> Mailing Address:
> 4770 Buford Highway, MS F-62
> Atlanta, Georgia 30341
> Telephone:
> 770-488-0668 (office)
> 770-378-1695 (cell)
> 	[[alternative HTML version deleted]]

Brian S. Diggs, PhD
Senior Research Associate, Department of Surgery
Oregon Health & Science University

More information about the R-help mailing list