pygmt.src.ClipAccessor.water

ClipAccessor.water(**kwargs)[source]

Clip the water areas (i.e., “wet” areas such as oceans and lakes) and only plot data inside.

Must be used as a context manager. Any plotting operations within the context manager will be clipped to the water 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.water():
...     fig.grdimage(grid, cmap="geo")
>>> fig.show()