xyListFromGrob: Generate Coordinates from Grobs

View source: R/grob.R

xyListFromGrobR Documentation

Generate Coordinates from Grobs

Description

This function generates a set of coordinates (a list of (x,y) lists) from a grob.

Usage

xyListFromGrob(x, op = if (closed) "union" else "flatten",
               closed = isClosedShape(x), ...)

Arguments

x

A grob.

op

A character value describing the operation to be used if x needs to be collapsed to a single shape. One of "intersection", "minus", "union", or "xor".

Can also be "flatten", which just returns an (x, y) list for each shape the grob draws. This is usually the best choice when closed = FALSE.

closed

A logical value indicating whether we coordinates describing a closed shape or an open shape from.

...

Arguments passed on to polyclip.

Value

The result is a list of lists, each with components x and y.

Author(s)

Paul Murrell

See Also

polyclip

Examples

r <- rectGrob(x=1/3, y=1/3, width=.4, height=.4)
xyListFromGrob(r)

gridGeometry documentation built on Sept. 11, 2024, 8:41 p.m.