I looked around and I have not found a nice solution for my goal.
I want to plot some data on a longitude/ latitude plot using ggplot2
and the coastline plus bathymetry with marmap
, everything in one single plot.
This script is to plot mydata
ggplot(data = ctd, aes(x = Longitude, y = Latitude)) +
geom_raster(aes(fill = Temp)) +
scale_fill_gradientn(colours = rev(my_colours)) +
geom_contour(aes(z = Temp), binwidth = 2, colour = "black", alpha = 0.2) +
#plot stations locations
geom_point(data = ctd, aes(x = Longitude, y = Latitude),
colour = 'black', size = 3, alpha = 1, shape = 15) +
#plot legends
labs(y = "Latitude", x = "Longitude", fill = "Temp (°C)") +
coord_cartesian(expand = 0)+
ggtitle("Temperature distribution")
Using marmap
I download the bathymetry
library(marmap)
Bathy <- getNOAA.bathy(lon1 = 37, lon2 = 38.7,
lat1 = -45.5, lat2 = -47.3, resolution = 1)
The result I would like to obtain is the distribution of mydata on Lon/Lat with the land colored in black plus grey lines for the bathymetry.