我想在几个点后面绘制一条跑道,所以我尝试了链接中建议的方法:In R, how to plot with a png as background? The correct graph looks like this.但是当我更改图像时,它似乎仅适用于一个特定的图像或编辑相同的图像,只绘制图像而不是点。 Plot gone wrong.
我身边一定有一些愚蠢的错误。任何人都可以指出,因为我是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])}