Learn R Programming

mapsf (version 1.2.0)

mf_background: Plot a background image

Description

Plot a background image on an existing plot

Usage

mf_background(filename, ...)

Value

No return value, a background image is displayed.

Arguments

filename

filename of the background image, PNG or JPG/JPEG format.

...

ignored

Examples

Run this code
if (require("jpeg")) {
  mtq <- mf_get_mtq()
  mf_map(mtq, col = NA, border = NA)
  mf_background(system.file("img/background.jpg", package = "mapsf"))
  mf_map(mtq, lwd = 3, col = NA, border = "white", add = TRUE)
  mf_credits(
    txt = "Background photo by Noita Digital on Unsplash",
    col = "white"
  )
}

Run the code above in your browser using DataLab