[R] expression() and font.lab ?

David Winsemius dwinsemius at comcast.net
Fri Apr 27 20:36:59 CEST 2012

On Apr 27, 2012, at 11:22 AM, aparna15 wrote:

> Hi..
> I managed to use expression() for superscripting and subscripting  
> values in
> my axis labels.

What's missing here is your plotting code and your machine and R  
installation details. You may want to review the Posting Guide for  
what is requested. Plotting issues are more machine dependent than  
other aspects. Since the ?plotmath page does have details that include:

"The fonts used are taken from the current font family, and so can be  
set by par(family=) in base graphics, and gpar(fontfamily=) in package  

Note that bold, italic and bolditalic do not apply to symbols, and  
hence not to the Greek symbols such as mu which are displayed in the  
symbol font. They also do not apply to numeric constants."

... my speculation is that you may not be using base graphics or you  
may have excessive expectations regarding how symbols are displayed.  
You can sometimes get around that last limitation by using character  
values where you want numeric values in bold or italic. Again, we need  
full details. Put together a reproducible example and repost.


> However, I notice that the font and style that I had passed
> through par() are ignored.
> I used :
> par(font.lab=2, font=2, family="sans")
> but when I employ expression() for my xlab, the styling given above is
> completely ignored.
> I would greatly appreciate it if someone knew of a method of  
> maintaing the
> style while superscripting or subscripting in an axis label.
> Regards,
> Aparna.
> --
> View this message in context: http://r.789695.n4.nabble.com/expression-and-font-lab-tp4592991p4592991.html
> Sent from the R help mailing list archive at Nabble.com.
> ______________________________________________
> 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.

David Winsemius, MD
West Hartford, CT

More information about the R-help mailing list