Modern mask and basemap

I am using modern mode for the first time, so I am not sure if I am understanding how it is supposed to work. It is very helpful that the examples often use the modern mode so we can learn easily how to get started using it.

I am generating a mask from a set of points with mask inside a gmt begin block. Then I use the mask to control greenspline to interpolate a grid through the points. After that I plot the points, run grdcontour, and close the block with end show.

The resulting plot has contours that look good, but it seems that the mask is being applied to the frame of the map, not just the contents. I tried adding basemap and coast at the beginning of the plot before the mask, but the frame is still masked out when it is far from the points. The coastline is not masked Here is the result:
Crucecita_total.pdf (29.3 KB)

Is this how the modern mode block is supposed to work? What can I do to avoid having my mask cut out parts of the frame?

Here is my script:
gmt begin Crucecita_total
gmt basemap -Ju14/1:800000 -R-96.56/-95.76/15.48/16.08 -B+t"Slip"
gmt coast -N1/0/0/0 -I1/0/0/255 -Wthick,black
gmt mask -R-96.56/-95.76/15.48/16.08 -I0.05 -S0.05d Crucecita-2D.center -Lmask_points.nc+o
gmt greenspline Crucecita-2D.center -Tmask_points.nc -Sc -V -D1 -Gtotal_slip.nc
gmt plot -B -Sc0.1 -Gblack Crucecita-2D.center
gmt mask -C
gmt grdcontour -C1 -A1 total_slip.nc
gmt end show

I am using the MacPorts port gmt6 @6.1.1_0+gdal+nonfree+pcre

Move the -B from plot to grdcontour since it is currently inside your clip path. Or add -B to basemap (you only set a title in that line).

Thanks! Probably a classic “modern mode” mistake. Now the map frame is good.

1 Like