ggimage brings images and graphics into ggplot2—from a picture at
each observation to a full-panel background or a miniature plot embedded
in the data.
With ggimage, you can:
- Map images to data: place local files, URLs, or generated image sources at data coordinates, with control over size, aspect ratio, rotation, colour, and transparency.
- Build image-based plots: add backgrounds with
geom_bgimage()and embed plots or other graphic objects as subviews withgeom_subview(). - Use ready-made image sources: draw flags, icons, emoji, Pokemon, or PhyloPic images without manually assembling image layers.
- Reduce overlap: use
geom_image_repel()to separate crowded image marks. - Make image plots interactive: use
geom_image_interactive()orgeom_phylopic_interactive()to add hover and selection interactions in HTML output viaggiraph.
Guangchuang YU https://yulab-smu.top
School of Basic Medical Sciences, Southern Medical University
Get the released version from CRAN:
## include BioC repo for dependencies
setRepositories(ind=1:2)
install.packages("ggimage")Or the development version from github:
setRepositories(ind=1:2)
## install.packages("devtools")
devtools::install_github("YuLab-SMU/ggimage")For examples and details, see the package vignette.