Skip to content

Commit 880b344

Browse files
Add inline example to surface (#1953)
1 parent 6b06361 commit 880b344

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

pygmt/src/surface.py

+12
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
)
1515
from pygmt.io import load_dataarray
1616

17+
__doctest_skip__ = ["surface"]
18+
1719

1820
@fmt_docstring
1921
@deprecate_parameter("outfile", "outgrid", "v0.5.0", remove_version="v0.7.0")
@@ -90,6 +92,16 @@ def surface(data=None, x=None, y=None, z=None, **kwargs):
9092
- :class:`xarray.DataArray`: if ``outgrid`` is not set
9193
- None if ``outgrid`` is set (grid output will be stored in file set by
9294
``outgrid``)
95+
96+
Example
97+
-------
98+
>>> import pygmt
99+
>>> # Load a sample table of topography
100+
>>> topography = pygmt.datasets.load_sample_data(
101+
... name="notre_dame_topography"
102+
... )
103+
>>> # Perform gridding of topography data
104+
>>> grid = pygmt.surface(data=topography, spacing=1, region=[0, 4, 0, 8])
93105
"""
94106
with GMTTempFile(suffix=".nc") as tmpfile:
95107
with Session() as lib:

0 commit comments

Comments
 (0)