ggpLayerSpatAnnOutline | R Documentation |
Adds a ggplot2 layer of polygons visualizing the outline of spatial annotations.
ggpLayerSpatAnnOutline(
object,
ids = NULL,
tags = NULL,
test = "any",
alpha = 0.5,
fill = NA,
line_alpha = 0.9,
line_color = "black",
line_size = 1,
line_type = "solid",
use_colors = FALSE,
clrp = NULL,
clrp_adjust = NULL,
inner = TRUE,
incl_edge = FALSE,
merge_edge = FALSE,
incr_vert = FALSE,
expand_outline = NULL,
xrange = getCoordsRange(object)$x,
yrange = getCoordsRange(object)$y,
...
)
object |
An object of class |
tags |
Character vector or |
test |
Character value. One of c('any'. 'all', 'identical', 'not_identical', 'none').
Specifies how input for |
fill |
Character value or NA. If character, specifies the color with which the outline of the spatial annotation is filled. |
line_alpha |
Numeric. Affects alpha of main lines of the plot. |
line_color |
Character. Affects color of the main lines of the plot. |
line_size |
Numeric. Affects size of the main lines of the plot. |
line_type |
Character. The line type. One of 'blank', 'solid', 'dashed', 'dotted', 'dotdash', 'longdash' and 'twodash'. |
use_colors |
Logical value. If |
clrp |
Character value. Specifies the color palette to be used to represent
groups of discrete variables. Run |
clrp_adjust |
Named character vector or NULL. If character, it adjusts the color palette that is used to represent the groups. Names of the input vector must refer to the group and the respective named element denotes the color with which to represent the group. |
inner |
Logical value. If |
incl_edge |
Logical value. If |
merge_edge |
Logical value. If |
incr_vert |
Logical value. If |
expand_outline |
Distance measure by which the outline of the area is expanded. |
xrange , yrange |
Distance vector of length
two or |
... |
Used to absorb deprecated arguments or functions. |
ggpLayer*()
-functions return lists of ggproto
objects
that can be added to ggplots via the +
operator. In most of the cases
they are supposed to be added to plots created with the plotSurface*()
family.
Adds two additional layers to set the scales for the color- and fill aesthetic of the plot.
expand_outline
only works if inner
is FALSE (or the spatial annotation
does not contain any inner borders).
ggpLayerSpatAnnPointer()
library(SPATA2)
library(patchwork)
object <- loadExampleObject("UKF275T")
object <-
createNumericAnnotations(
object = object,
variable = "HM_HYPOXIA",
threshold = "kmeans_high",
id = "hypoxia_ann",
inner_borders = FALSE,
force1 = TRUE
)
# range of hypoxia annotation
hr <- getSpatAnnRange(object, id = "hypoxia_ann")
hr_ggpL <- ggpLayerSpatAnnOutline(object, ids = "hypoxia_ann")
plotSurface(object, "HM_HYPOXIA") + hr_ggpL
p_rect <-
plotImage(object) +
hr_ggpL +
ggpLayerRect(object, xrange = hr$x, yrange = hr$y)
p_zoomed <-
plotImage(object) +
ggpLayerZoom(object, xrange = hr$x, yrange = hr$y)
p_rect + p_zoomed
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.