Learn R Programming

Gmisc (version 3.0.3)

moveBox: Move a boxGrob

Description

Moves a boxGrob/boxPropGrob by modifying it's viewport. This can be useful if you want to create a series of boxes whose position are relative to each other and depend on each box's width/height.

Usage

moveBox(
  element,
  x = NULL,
  y = NULL,
  space = c("absolute", "relative"),
  just = NULL
)

Value

The element with updated

Arguments

element

A boxGrob/boxPropGrob object.

x

A unit element or a numeric that can be converted to a npc unit object.

y

A unit element or a numeric that can be converted to a npc unit object.

space

We can provide absolute that confers the box absolute position within the parent viewport. If relative the movement is related to the current position.

just

The justification of an argument as used by viewport some tiny differences: (1) you only want to change the justification in the vertical direction you can retain the existing justification by using NA, e.g. c(NA, 'top'), (2) if you specify only one string and that string is either top or bottom it will assume vertical justification.

See Also

Other flowchart components: align, boxGrob(), boxPropGrob(), connectGrob(), coords(), distance(), spread

Examples

Run this code
library(grid)
grid.newpage()

box <- boxGrob("A simple box", x = .5, y = .8)
moveBox(box, x = -.2, space = "relative")

Run the code above in your browser using DataLab