Jonathan Williams
2009-Jun-05 17:28 UTC
[R] Mixed Latin, Greek and subscript characters in axis label
Dear R-helpers, I have been trying to figure out how to plot a graph with an axis label consisting of a mixture of Latin, Greek and subscript characters. Specifically, I need to write A[beta]{1-42}, where A is Latin script A, [beta] is Greek lower case beta and {1-42} is subscript '1-42'. I can use xlab=expression(beta[1-42]) and obtain the [beta]{1-42} part of the label. But, I can't add the preceding Latin character A to this expression. I have tried xlab=expression(A,beta[1-42]), which simply prints 'A'. I have tried xlab=paste('A',expression(beta[1-42])), but this prints "A (beta[1-42])". Anything else that I try returns an error (e.g. xlab=expression(A beta[1]42]) returns 'Error: unexpected symbol'). So, I would be very grateful if someone can tell me how to write my label. Thanks, Jonathan Williams
baptiste auguie
2009-Jun-05 18:30 UTC
[R] Mixed Latin, Greek and subscript characters in axis label
Jonathan Williams wrote:> Dear R-helpers, > > I have been trying to figure out how to plot a graph with an axis label > consisting of a mixture of Latin, Greek and subscript characters. > Specifically, I need to write A[beta]{1-42}, where A is Latin script A, > [beta] is Greek lower case beta and {1-42} is subscript '1-42'. > I can use xlab=expression(beta[1-42]) and obtain the [beta]{1-42} part of > the label. But, I can't add the preceding Latin character A to this > expression. > I have tried xlab=expression(A,beta[1-42]), which simply prints 'A'. I have > tried xlab=paste('A',expression(beta[1-42])), but this prints "A > (beta[1-42])". > Anything else that I try returns an error (e.g. xlab=expression(A > beta[1]42]) returns 'Error: unexpected symbol'). > So, I would be very grateful if someone can tell me how to write my label. > > Thanks, > > Jonathan Williams > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >try xlab=expression(A*beta[1-42]) ?plotmath entry * x*y juxtapose x and y HTH, baptiste
Reasonably Related Threads
- RFT: Use Greek semicolons for comdlg32's printer status enumeration?
- How to Include greek symbol in axis label?
- Supperscript, subscript and double lines in the main/sub title and using greek letters
- complex subscript/superscript on axis labels
- Greek simbols in dialogs.