Skip to content
Prev 367328 / 398506 Next

[FORGED] Re: single strip for the same group in dotplot lattice

Hi

The following is a bit customised to your example, but maybe if there's 
no other way ...

library(grid)
## Go down to the viewport that lays everything out
downViewport("plot_01.toplevel.vp")
## Eyeball the widths and heights (the "null"s are the plot regions)
## current.viewport()$layout$widths
## current.viewport()$layout$heights
## Make a viewport along the top strips and draw in it
pushViewport(viewport(layout.pos.col=7:25,
                       layout.pos.row=8))
grid.rect(y=1, height=unit(1, "lines"), just="top",
           gp=gpar(fill="paleturquoise"))
grid.text("run_2", y=unit(1, "npc") - unit(.5, "lines"))
upViewport()
## Make a viewport along the bottom strips and draw in it
pushViewport(viewport(layout.pos.col=7:25,
                       layout.pos.row=12))
grid.rect(y=1, height=unit(1, "lines"), just="top",
           gp=gpar(fill="paleturquoise"))
grid.text("run_1", y=unit(1, "npc") - unit(.5, "lines"))
upViewport()

Paul
On 23/02/17 22:00, Luigi Marongiu wrote: