I wanted to plot a runway behind a few points, so I tried the method suggested in the link : In R, how to plot with a png as background? The correct graph looks like this. But it seems to work only for one particular image, when I change the image or edit the same image, only the image gets plotted and not the points. Plot gone wrong.
There must be some silly mistake from my side. Can anyone please point it out as I'm new to R?
plot(x = D, y = G , pch = c(15,16,17,18) , col = c("red", "blue", "green", "orange"), ylim = range(-40,40), xlim = range(0,2500), cex = 1.5)
img <- readPNG("runway.png")
lim <- par()
rasterImage(img, lim$usr[1], lim$usr[3], lim$usr[2], lim$usr[4])}