Adds the capture area as a rectangular and/or crops the frame of the plot accordingly.

ggpLayerCaptureArea(
  object,
  opt = c("outline"),
  line_clr = "black",
  line_type = "solid",
  line_size = 1,
  expand_x = ggplot2::waiver(),
  expand_y = ggplot2::waiver(),
  img_name = activeImage(object)
)

Arguments

object

An object of class SPATA2 or, in case of S4 generics, objects of classes for which a method has been defined.

opt

Combination of 'rect' and/or 'crop'.

line_type

Character. The line type. One of 'blank', 'solid', 'dashed', 'dotted', 'dotdash', 'longdash' and 'twodash'.

line_size

Numeric. Affects size of the main lines of the plot.

expand_x, expand_y

Given to expand of ggplot2::scale_x/y_continuous().

img_name

Character value. The name of the image of interest. If NULL, the active image is chosen by default. Either way, must be one of getImageNames().

Value

List of ggpLayer outputs.

See also

Examples


library(SPATA2)

data("example_data")

object <- loadExampleObject("UKF275T")

plotImage(object) +
 ggpLayerCaptureArea(object, opt = "outline")

plotImage(object) +
 ggpLayerCaptureArea(object, opt = "crop")