pygmt.src.ClipAccessor.land

ClipAccessor.land(**kwargs)[source]

Clip the land area (i.e., “dry” areas) and only plot data inside.

Must be used as a context manager. Any plotting operations within the context manager will be clipped to the land areas.

Parameters:

kwargs – Additional keyword arguments passed to pygmt.Figure.coast. Not all parameters make sense in this context.

Examples

>>> from pygmt import Figure
>>> from pygmt.datasets import load_earth_relief
>>>
>>> grid = load_earth_relief()
>>> fig = Figure()
>>> fig.basemap(region="g", projection="W15c", frame=True)
>>> with fig.clip.land():
...     fig.grdimage(grid, cmap="geo")
>>> fig.show()