Background Images to the charts/plots created using ggplot/ggplot2 in R Server

Hi,

Need help in adding background image to the Charts/Plots created using ggplot in R Server to display in R Shiny.

Check out the ggbackground() function in ggimage:


Below is before I found ggbackground
You might take a look at the ggpomological package as an example to work from, since it uses a background image for the plot.

You wouldn't actually use ggpomological, you'd likely use the packages it uses (e.g. magick), but it's nice to see someone else's approach.
https://cran.r-project.org/web/packages/magick/vignettes/intro.html

There's another approach described in this post, though I haven't worked with the packages it uses personally;
https://datascienceplus.com/how-to-add-a-background-image-to-ggplot2-graphs/

3 Likes

For the sake of completeness, cowplot can also layer images into ggplot2 plots. See the example at the end of this vignette:
https://cran.r-project.org/web/packages/cowplot/vignettes/introduction.html

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.