Skip to contents

M() and mm() move the "pen" to a new point.

Usage

M(
  x,
  y = NULL,
  ...,
  sep = getOption("dee.sep", ","),
  origin_at_bottom = getOption("dee.origin_at_bottom", FALSE),
  height = getOption("dee.height", NULL),
  digits = getOption("dee.digits", Inf)
)

mm(
  x,
  y = NULL,
  ...,
  sep = getOption("dee.sep", ","),
  origin_at_bottom = getOption("dee.origin_at_bottom", FALSE),
  height = getOption("dee.height", NULL),
  digits = getOption("dee.digits", Inf)
)

MZ(...)

mz(...)

Arguments

x

If y is NULL will be coerced by affiner::as_coord2d(). Else a numeric vector.

y

Either NULL or a numeric vector.

...

Passed to related function.

sep

Either "," or " ".

origin_at_bottom, height

If origin_at_bottom is TRUE then y (and any y1 and y2) coordinates is transformed by height - y for absolute coordinates and -y for relative coordinates.

digits

x and y (and any x1, y1, x2, y2) will be transformed by round(, digits). An Inf (default) means no rounding.

Value

A dee() object.

Examples

M(1, 1) + L(2, 2) + Z()
#> <dee[1]>
#> M 1,1 L 2,2 Z
M(1, 1) + ll(1, 1) + zz()
#> <dee[1]>
#> M 1,1 l 1,1 z
d <- MZ(x = c(2, 5, 8, 5), y = c(5, 8, 5, 2))
if (requireNamespace("omsvg", quietly = TRUE) &&
    requireNamespace("nanosvgr", quietly = TRUE)) {
  plot(d, height = 10, width = 10,
       fill = "red", stroke = "black", stroke_width = 4)
}