[R] lattice: How to vertically adjust an axis label?

David Winsemius dwinsemius at comcast.net
Sat Jul 9 01:12:14 CEST 2011

On Jul 8, 2011, at 6:54 PM, Marius Hofert wrote:

> Dear expeRts,
> How can I vertically adjust an axis tick label so that it is nicely  
> aligned with
> the other labels?
> library(lattice)
> xyplot(0~0, xlim=c(0,3), scales=list(x=list(at=c(1,1.1),  
> labels=c(expression(hat(theta)[italic(n)]),expression(theta)))))
> ## aim: move the leftmost expression up so that theta is nicely  
> aligned with the second

I don't know how to make a phantom <hat>,  so see if this is any more  
aesthetically acceptable:

xyplot(0~0, xlim=c(0,3), scales=list(x=list(at=c(1,1.1),    labels=c(
       expression(atop(phantom(), hat(theta)[italic(n)])),
        expression(atop(phantom(),theta))                     )

> theta.
> Cheers,
> Marius
> ______________________________________________
> 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