Learn R Programming

sfcurve (version 1.0.0)

sfc_grob,sfc_base-method: The graphics object

Description

The graphics object

Usage

# S4 method for sfc_base
sfc_grob(p)

# S4 method for sfc_sequence sfc_grob( p, bases = NULL, extend = FALSE, title = FALSE, closed = FALSE, lwd = 4, col = NULL, ... )

# S3 method for sfc_sequence plot( x, bases = NULL, grid = FALSE, extend = FALSE, title = FALSE, closed = FALSE, ... )

# S4 method for sfc_nxn sfc_grob( p, bases = p@rules@bases, extend = FALSE, title = FALSE, closed = FALSE, ... )

# S3 method for sfc_nxn plot(x, grid = FALSE, extend = FALSE, title = FALSE, closed = FALSE, ...)

# S4 method for matrix sfc_grob(p, title = NULL, closed = FALSE, lwd = 4, col = NULL, ...)

Value

A grid::grob() object.

Arguments

p

The corresponding object.

bases

A list of base patterns, normally BASE_LIST is used.

extend

Whether to add the entry and exit segments?

title

Whether to add title on the top of the plot? The title is constructed in the form of initial_seed|expansion_code, e.g. I|111. The value can also be a string.

closed

Whether the curve is closed?

lwd

Line width.

col

Color for segments. If the value is NULL, it uses the "Spectral" color palettes.

...

Other arguments passed to grid::viewport() or sfc_grob().

x

The corresponding object.

grid

Whether to add grid lines on the plot?

Details

If p is an sfc_sequence and p contains base patterns defined in "I/J/R/L/U/B/D/P/Q/C", the default BASE_LIST is automatically used for bases. If p is an sfc_nxn object, bases is already stored in p and it is passed to this function automatically.

Examples

Run this code
sfc_grob(BASE_I)
plot(sfc_2x2("I", "11"))
plot(sfc_2x2("I", "11"), extend = TRUE, title = TRUE, grid = TRUE)
plot(sfc_sequence("IIIRRR"))

Run the code above in your browser using DataLab