These functions are basic plot implementations for the geovctrs types. Similar plot() methods are available for well-known types in the wkutils package.

# S3 method for geovctrs_xy
plot(
  x,
  ...,
  add = FALSE,
  asp = 1,
  bbox = geo_bbox(x, finite = TRUE),
  xlab = "",
  ylab = ""
)

# S3 method for geovctrs_segment
plot(
  x,
  ...,
  add = FALSE,
  asp = 1,
  bbox = geo_bbox(x, finite = TRUE),
  xlab = "",
  ylab = ""
)

# S3 method for geovctrs_rect
plot(
  x,
  ...,
  add = FALSE,
  asp = 1,
  bbox = geo_bbox(x, finite = TRUE),
  xlab = "",
  ylab = ""
)

Arguments

x

A geometry-like object, or one that can be coerced to a geometry-like object using as_geovctr().

...

Passed to plotting functions for features: graphics::points() for xy vectors, graphics::segments() for segment vectors, and graphics::rect() for rectangles.

add

Should the object be added the current plot?

asp, xlab, ylab

Passed to graphics::plot()

bbox

The limits of the plot. Defaults to geo_bbox(x, finite = TRUE).

Value

x, invisibly.

Examples

plot(geo_xy(1:5, 1:5))
plot(geo_segment(0, 0, 1, 1))
plot(geo_rect(0, 1, 2, 3), col = "grey90")