Plot swath profile using pygmt

Dear all,

It seems grdtrack is implemented in pygmt but I can not keys similar

Is it possible to plot this example in pygmt

Best regards,

Yes it should be possible. The -G in grdtrack has been aliased to grid in PyGMT, though it’s not appearing in the docs. For example, the GMT command like:

gmt grdtrack ridge.txt -C400k/2k/10k+v -Sm+sstack.txt > table.txt

would look like this in PyGMT:

pygmt.grdtrack(points="ridge.txt", grid="", crossprofile="400k/2k/10k+v", stack="m+sstack.txt", outfile="table.txt")

See also code at where this is being handled.

1 Like