Gmt coast plot with polygon based boundary

Hi there,

I want to plot coastline with boundary that I define a txt file with a closed shape polygon. Example:

gmt coast -B -J -Rtxtfile_contains_boundary_polygon

Or alternatively, is there any way to cut coastline data according to a given polygon in a text file. (-M option with given boundary)

Thank you for taking time.

For -R you will need to first run gmt info -Itxtfile_contains_boundary_polygon to get a valid -Rstring.
If you only want data inside the polygon then you either have to clip the plot with clip (so only things inside your polygon shows) or you will need to use gmtselect -F to try to contain only points inside the polygon.