Skip to content
Prev 6822 / 12125 Next

[R-pkg-devel] Problem with S4 method for plotting a raster file

On 14/04/2021 5:41 a.m., Jacob Nabe-Nielsen wrote:
I'm not sure exactly what is going wrong, but if you plot the coastline 
first and the bathymetry second, things do show up.  Maybe that's enough 
of a hint for you:

library(DEPONS2R)
data("coastline")
library(rgdal)
coastline2 <- spTransform(coastline, crs(bathymetry))
plot(coastline2, col="lightyellow2")

data("bathymetry")
plot(bathymetry, add=TRUE)

This puts the legend on top of the plotted coastline data, so my guess 
is that the limits of the bathymetry plot aren't being made available to 
the coastline plot when you do things in the original order.

Duncan Murdoch