Add inline example for sph2grd
Add an inline example for the sph2grd documentation.
@@ -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:
