Skip to content

Commit 6b06361

Browse files
Add inline example for grdfill (#1954)
Co-authored-by: Dongdong Tian <[email protected]>
1 parent 973b948 commit 6b06361

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

pygmt/src/grdfill.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
)
1414
from pygmt.io import load_dataarray
1515

16+
__doctest_skip__ = ["grdfill"]
17+
1618

1719
@fmt_docstring
1820
@use_alias(
@@ -62,6 +64,17 @@ def grdfill(grid, **kwargs):
6264
- :class:`xarray.DataArray` if ``outgrid`` is not set
6365
- None if ``outgrid`` is set (grid output will be stored in file set by
6466
``outgrid``)
67+
68+
Example
69+
-------
70+
>>> import pygmt
71+
>>> # Load a bathymetric grid with missing data
72+
>>> earth_relief_holes = pygmt.datasets.load_sample_data(
73+
... name="earth_relief_holes"
74+
... )
75+
>>> # Perform grid filling operations on the sample grid
76+
>>> # Set all empty values to "20"
77+
>>> filled_grid = pygmt.grdfill(grid=earth_relief_holes, mode="c20")
6578
"""
6679
if kwargs.get("A") is None and kwargs.get("L") is None:
6780
raise GMTInvalidInput("At least parameter 'mode' or 'L' must be specified.")

0 commit comments

Comments
 (0)