Skip to content

Commit b16d10d

Browse files
Add inline example for grdgradient (#1720)
1 parent b1801da commit b16d10d

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

pygmt/src/grdgradient.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,21 @@ def grdgradient(grid, **kwargs):
148148
- :class:`xarray.DataArray` if ``outgrid`` is not set
149149
- None if ``outgrid`` is set (grid output will be stored in file set by
150150
``outgrid``)
151+
152+
153+
Example
154+
-------
155+
>>> import pygmt # doctest: +SKIP
156+
>>> # Load a grid of @earth_relief_30m data, with an x-range of 10 to 30,
157+
>>> # and a y-range of 15 to 25
158+
>>> grid = pygmt.datasets.load_earth_relief(
159+
... resolution="30m", region=[10, 30, 15, 25]
160+
... ) # doctest: +SKIP
161+
>>> # Create a new grid from an input grid, set the azimuth to 10 degrees,
162+
>>> # and the direction to "c" for Cartesian coordinates
163+
>>> new_grid = pygmt.grdgradient(
164+
... grid=grid, azimuth=10, direction="c"
165+
... ) # doctest: +SKIP
151166
"""
152167
with GMTTempFile(suffix=".nc") as tmpfile:
153168
if "Q" in kwargs and "N" not in kwargs:

0 commit comments

Comments
 (0)