Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

visualise

Visualise geometric objects


Description

Visualise geometric objects

Usage

visualise(
  ...,
  window = NULL,
  trace = FALSE,
  new = TRUE,
  clip = TRUE,
  theme = gtTheme
)

Arguments

...

objects to plot and optional graphical parameters.

window

[data.frame(1)]
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

[list(7)]
the theme from which to take graphical parameters; see setTheme for details.

Value

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

Examples

# make an empty plot
visualise()
visualise(window = getExtent(gtRasters$continuous))

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

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

(aRaster <-  gtRasters$categorical)

# plot several objects together
visualise(aRaster, aGeom)

# give names
visualise(`a raster` = aRaster, `a geom` = aGeom)

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

# ... or a theme
visualise(aRaster, theme = setTheme(title = list(plot = FALSE)))

geometr

Generate and Modify Interoperable Geometric Shapes

v0.2.10
GPL-3
Authors
Steffen Ehrmann [aut, cre] (<https://orcid.org/0000-0002-2958-0796>), Dan Sunday [cph] (fast point-in-polygon algorithm.)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.