在 R 中的 shapefile 上绘制空间数据集的坐标时如何绘制它?
How do I plot the coordinates of a spatial dataset when plotting it over a shapefile in R?
我正在将考古发现的 SpatialPointsDataFrame 对象绘制在发现它们的沟渠的 shapefile 上。到目前为止,我已经设法加载并绘制了两组数据:
coordinates(finds) <- ~x+y
trencharea <- readOGR(dsn="excpoly", layer="excpoly")
trencharea <- as.owin(trencharea)
plot(trencharea, main= "Trench & Finds")
plot(finds, add=TRUE, col = "blue", pch = 4)
但是,我还希望与发现相关的 x 和 y 坐标显示在我的绘图的 x 和 y 轴上。我该怎么做呢?我不是在寻找涉及 ggplot
的解决方案
不知道我理解的对不对,你是不是在找下面的
plot(trencharea, main= "Trench & Finds")
plot(finds, add=TRUE, col = "blue", pch = 4)
axis(1)
axis(2)
box(col = 'black')
虚拟情节
我正在将考古发现的 SpatialPointsDataFrame 对象绘制在发现它们的沟渠的 shapefile 上。到目前为止,我已经设法加载并绘制了两组数据:
coordinates(finds) <- ~x+y
trencharea <- readOGR(dsn="excpoly", layer="excpoly")
trencharea <- as.owin(trencharea)
plot(trencharea, main= "Trench & Finds")
plot(finds, add=TRUE, col = "blue", pch = 4)
但是,我还希望与发现相关的 x 和 y 坐标显示在我的绘图的 x 和 y 轴上。我该怎么做呢?我不是在寻找涉及 ggplot
的解决方案不知道我理解的对不对,你是不是在找下面的
plot(trencharea, main= "Trench & Finds")
plot(finds, add=TRUE, col = "blue", pch = 4)
axis(1)
axis(2)
box(col = 'black')
虚拟情节