First time working with map data, so pardon failures in terminology.
I looked through this forum/the internet and I couldn’t find this usage of GMT, through I’m sure it has been done. Sorry if this is a duplicate post…
I am trying to create a map consisting of just the country outline with elevation data inside. (ie Elevation data inside the Romania border, just transparent (or white) outside).
Below is my best attempt, but notice there is some extra land included near the bottom left. Also, I’d like this to be flexible for any country, so I don’t want to have to figure out which country codes to white-out with the dcw
option every time I want to make one of these maps.
import pygmt
fig = pygmt.Figure()
# Load sample earth relief data
region = "RO+r1"
fig.basemap(region=region, projection="M3i", frame=True)
grid = pygmt.datasets.load_earth_relief(resolution="30s", region=region,)
fig = pygmt.Figure()
fig.grdimage(grid=grid, projection="M3i")
#fig.grdcontour(grid=grid)
fig.coast(
region=region,
water='white',
dcw="SK,XK,MD,BG,UA,HU,RS+gWhite"
)
fig.show()