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

ggpLayerCaptureArea(
  object,
  opt = c("rect"),
  rect_alpha = 0.9,
  rect_clr = "black",
  rect_line_type = "solid",
  rect_size = 1,
  expand_rect = 0.025,
  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'.

rect_alpha

The alpha transparency level of the rectangle's border

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 = "rect")

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