Skip to content
Prev 59527 / 398502 Next

Location of grobs etc on lattice output

On Sunday 21 November 2004 16:35, John Maindonald wrote:
I think you want "npc" rather than "native" here. x=0 on the native 
scale is outside the device area.
This is a bug in trellis.unfocus, caused by my not reading grid 
documentation carefully enough, I didn't notice that upViewport(0) 
jumps to the root viewport instead of going up 0 viewports. I'll post 
an update soon.

Quick fix:

assignInNamespace("trellis.unfocus", ns = "lattice",
                  value = function()
{
    if (lattice:::lattice.getStatus("vp.highlighted"))
    {
        grid.remove("lvp.highlight", warn = FALSE)
        lattice:::lattice.setStatus(vp.highlighted = FALSE)
    }
    lattice:::lattice.setStatus(current.focus.column = 0,
                      current.focus.row = 0)
    if (lattice:::lattice.getStatus("vp.depth") > 0)
        upViewport(lattice:::lattice.getStatus("vp.depth"))
    lattice:::lattice.setStatus(vp.depth = 0)
    invisible()
})
True, but it may be overkill for the amount of use it would get.

Deepayan