Visualise geometric objects
visualise( ..., window = NULL, trace = FALSE, new = TRUE, clip = TRUE, theme = gtTheme )
... | objects to plot and optional graphical parameters. |
---|---|
window | [ |
trace | [ |
new | [ |
clip | [ |
theme | [ |
Returns invisibly an object of class recordedplot
, see
recordPlot
for details (and warnings).
# make an empty plot visualise() visualise(window = getExtent(gtGeoms$grid$continuous)) coords <- data.frame(x = c(30, 60, 60, 40), y = c(40, 40, 60, 70), fid = 1) (aGeom <- gs_polygon(anchor = coords)) #> geom polygon #> 1 group | 1 feature | 5 points #> crs cartesian #> attributes -- #> tiny map 70 #> ◌ ◎ ◌ ◌ #> ◌ ◌ ◌ ◎ #> ◌ ◌ ◌ ◌ #> 30 ◉ ◌ ◌ ◎ 60 #> 40 visualise(aGeom) win <- data.frame(x = c(0, 80), y = c(0, 80)) withWindow <- setWindow(x = aGeom, to = win) visualise(expanded = withWindow) (aRaster <- gtGeoms$grid$continuous) #> geom grid #> 1 layers | 3360 cells #> crs cartesian #> attributes -- #> resolution 1 1 (x, y) #> extent 0 60 0 56 (xmin, xmax, ymin, ymax) # 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)))