grid.frame

0th

Percentile

Create a Frame for Packing Objects

These functions, together with grid.pack, grid.place, packGrob, and placeGrob are part of a GUI-builder-like interface to constructing graphical images. The idea is that you create a frame with this function then use grid.pack or whatever to pack/place objects into the frame.

Keywords
dplot
Usage
grid.frame(layout=NULL, name=NULL, gp=gpar(), vp=NULL, draw=TRUE)
frameGrob(layout=NULL, name=NULL, gp=gpar(), vp=NULL)
Arguments
layout

A Grid layout, or NULL. This can be used to initialise the frame with a number of rows and columns, with initial widths and heights, etc.

name

A character identifier.

vp

An object of class viewport, or NULL.

gp

An object of class gpar; typically the output from a call to the function gpar.

draw

Should the frame be drawn.

Details

Both functions create a frame grob (a graphical object describing a frame), but only grid.frame() draws the frame (and then only if draw is TRUE). Nothing will actually be drawn, but it will put the frame on the display list, which means that the output will be dynamically updated as objects are packed into the frame. Possibly useful for debugging.

Value

A frame grob. grid.frame() returns the value invisibly.

See Also

grid.pack

Aliases
  • grid.frame
  • frameGrob
Examples
library(grid) grid.newpage() grid.frame(name="gf", draw=TRUE) grid.pack("gf", rectGrob(gp=gpar(fill="grey")), width=unit(1, "null")) grid.pack("gf", textGrob("hi there"), side="right")
Documentation reproduced from package grid, version 3.4.1, License: Part of R 3.4.1

Community examples

Looks like there are no examples yet.