geo_vis: Visualise geometric objects

View source: R/geo_vis.R

geo_visR Documentation

Visualise geometric objects

Description

Visualise geometric objects

Usage

geo_vis(
  ...,
  window = NULL,
  trace = FALSE,
  new = TRUE,
  clip = TRUE,
  theme = geoTheme
)

Arguments

...

objects to plot and optional graphical parameters.

window

data.frame(2)
two opposing corners of a rectangle to which the plot is limited.

trace

logical(1)
Print the provenance information of the geometric object (if available) (TRUE), or simply plot the object (FALSE, default).

new

logical(1)
force a new plot (TRUE, default).

clip

logical(1)
clip the plot by the plot box (TRUE, default), or plot also objects that go beyond the plot box.

theme

geometr theme
the theme from which to take graphical parameters; see geo_theme for details.

Value

Returns invisibly an object of class recordedplot, see recordPlot for details (and warnings).

Examples

# make an empty plot
geo_vis()
geo_vis(window = getExtent(gtGeoms$grid))

coords <- data.frame(x = c(30, 60, 60, 40),
                     y = c(40, 40, 60, 70),
                     fid = 1)
(aGeom <- gs_polygon(anchor = coords))
geo_vis(aGeom)

win <- data.frame(x = c(0, 80),
                  y = c(0, 80))
withWindow <- geomio::setWindow(x = aGeom, to = win)
geo_vis(expanded = withWindow)

(aRaster <- gtGeoms$grid)

# plot several objects together ...
geo_vis(aRaster, aGeom)

# ... and give them names
geo_vis(`a raster` = aRaster, `a geom` = aGeom)

# use graphical parameters ...
geo_vis(aGeom, linecol = "green")

# ... or a theme
geo_vis(aRaster, theme = geo_theme(title = list(plot = FALSE)))


EhrmannS/geometr documentation built on Jan. 31, 2024, 9:13 a.m.