View source: R/annotation-gspace.R
| annotation_gspace | R Documentation |
annotation_gspace() is a generic dispatcher for adding annotation
layers to a ggplot-based GraphSpace plot. The type
argument selects the annotation type; additional arguments are forwarded
to the corresponding handler.
annotation_gspace(..., type = "image")
annotation_gspace_image(
raster,
interpolate = FALSE,
opacity = 1,
flip.v = FALSE,
flip.h = FALSE
)
... |
Arguments forwarded to the annotation handler selected by
|
type |
A string specifying the annotation type. Currently available:
|
raster |
An image to be displayed. Accepted types:
|
interpolate |
A logical value indicating whether to apply linear
interpolation when the image is rendered at a different resolution than
its native size. Defaults to |
opacity |
A numeric value in |
flip.v |
A logical value; if |
flip.h |
A logical value; if |
A ggplot2 layer object that can be added to a ggplot()
call with +, or invisible(NULL) with a warning if the
image could not be resolved.
annotation_raster,
gs_image,
geom_nodespace,
geom_edgespace
# Assuming 'gs' is a GraphSpace object with
# an image stored in gs_image(gs)
## Not run:
# Pass a GraphSpace object directly
ggplot(gs) +
annotation_gspace(gs) +
geom_edgespace() +
geom_nodespace()
# Extract the image explicitly
ggplot(gs) +
annotation_gspace(gs_image(gs)) +
geom_edgespace() +
geom_nodespace()
# Dim the background and flip vertically
ggplot(gs) +
annotation_gspace(gs, opacity = 0.5, flip.v = TRUE) +
geom_edgespace() +
geom_nodespace()
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.