Description Usage Arguments Author(s) Examples
View source: R/background_image.R
Add background image to ggplot2.
1 | background_image(raster.img)
|
raster.img |
raster object to display, as returned by the function
|
Alboukadel Kassambara <alboukadel.kassambara@gmail.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ## Not run:
install.packages("png")
# Import the image
img.file <- system.file(file.path("images", "background-image.png"),
package = "ggpubr")
img <- png::readPNG(img.file)
# Plot with background image
ggplot(iris, aes(Species, Sepal.Length))+
background_image(img)+
geom_boxplot(aes(fill = Species), color = "white")+
fill_palette("jco")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.