Skip to contents

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, ...)

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?

Value

A grid::grob() object.

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

sfc_grob(BASE_I)
#> gTree[GRID.gTree.4] 
plot(sfc_2x2("I", "11"))

plot(sfc_2x2("I", "11"), extend = TRUE, title = TRUE, grid = TRUE)

plot(sfc_sequence("IIIRRR"))