Re: [R] Grid: constructing a gTree with grobs that use named viewports from a vpTree

From: hadley wickham <h.wickham_at_gmail.com>
Date: Tue 04 Oct 2005 - 04:50:47 EST

> But I get:
>
> Error in downViewport.vpPath(vp, strict = TRUE, recording = FALSE) :
> Viewport 'tl' was not found
>
> presumably because no equivalent of the upViewport(1) command is used.
>
> What should I be doing here?

I've solved my own problem - I need to use childrenvp instead and construct a fuller viewport path:

grobs <- gList(

	rectGrob(vp=vpPath("layout","tl")),
	textGrob("Top left", vp=vpPath("layout","tl")),
	textGrob("Bottom right", vp=vpPath("layout","br"))
)

grid.draw(gTree(childrenvp=vp, children = grobs))

Hadley



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Tue Oct 04 04:55:07 2005

This archive was generated by hypermail 2.1.8 : Sun 23 Oct 2005 - 18:15:41 EST