Skip to content
Prev 70004 / 398506 Next

Lattice: how to get default ylim?

On Thursday 19 May 2005 8:00 am, David James wrote:
No, I think it's been there for a while. However, AFAIR the fact that 
viewports have components xscale and yscale that can be accessed like this is 
undocumented and may change if the implementation changes (which is a real 
possibility). 

Ideally, there should be exported interfaces to access this information, 
either in grid or lattice. One of the reasons there isn't is that you rarely 
need it, including in this example (see below).
An equivalent version where you don't need xlim and ylim is 

     grid.text(x = 0, y = 1, default.units="npc",
        label = "Hello World", just= c("left", "top"))

Deepayan