plot.geovctrs_xy: Plot geometry vectors

Description Usage Arguments Value Examples

View source: R/geo-plot.R

Description

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

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
## S3 method for class 'geovctrs_xy'
plot(
  x,
  ...,
  add = FALSE,
  asp = 1,
  bbox = geo_bbox(x, finite = TRUE),
  xlab = "",
  ylab = ""
)

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

## S3 method for class '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

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

paleolimbot/geovctrs documentation built on July 30, 2020, 3:41 p.m.