diff --git a/pygmt/src/grdcut.py b/pygmt/src/grdcut.py index b16b3234acc..f922aaaf04f 100644 --- a/pygmt/src/grdcut.py +++ b/pygmt/src/grdcut.py @@ -87,6 +87,20 @@ def grdcut(grid, **kwargs): - :class:`xarray.DataArray` if ``outgrid`` is not set - None if ``outgrid`` is set (grid output will be stored in file set by ``outgrid``) + + Examples + -------- + >>> import pygmt # doctest: +SKIP + >>> # Load a grid of @earth_relief_30m data, with an x-range of 10 to 30, + >>> # and a y-range of 15 to 25 + >>> grid = pygmt.datasets.load_earth_relief( + ... resolution="30m", region=[10, 30, 15, 25] + ... ) # doctest: +SKIP + >>> # Create a new grid from an input grid, with an x-range of 12 to 15, + >>> # and a y-range of 21 to 24 + >>> new_grid = pygmt.grdcut( + ... grid=grid, region=[12, 15, 21, 24] + ... ) # doctest: +SKIP """ with GMTTempFile(suffix=".nc") as tmpfile: with Session() as lib: