diff --git a/pygmt/src/sph2grd.py b/pygmt/src/sph2grd.py index 114c1df6bf9..163f420c540 100644 --- a/pygmt/src/sph2grd.py +++ b/pygmt/src/sph2grd.py @@ -63,6 +63,15 @@ def sph2grd(data, **kwargs): - :class:`xarray.DataArray` if ``outgrid`` is not set - None if ``outgrid`` is set (grid output will be stored in file set by ``outgrid``) + + Example + ------- + >>> import pygmt # doctest: +SKIP + >>> # Create a new grid from the remote file "EGM96_to_36.txt", + >>> # set the grid spacing to 1, and the region to "g" + >>> new_grid = pygmt.sph2grd( + ... data="@EGM96_to_36.txt", spacing=1, region="g" + ... ) # doctest: +SKIP """ with GMTTempFile(suffix=".nc") as tmpfile: with Session() as lib: