rplotcontourrworldmap

Rworldmap with Contour Plot


When one uses package(rworldmap), when one is making a contour plot, like:

    X <- Longitude
    Y <- Latitude
    contour(x=X, y=Y, z=Z, xlim=c(min(X),max(X)), ylim=c(min(Y),max(Y)), nlevels=15)

How can this contour plot appear on the world map?


Solution

  • It is actually quite simple, just add:

    plot(getMap())
    

    after your contour statement.