Skip to content

Commit

Permalink
Add inline example for grdgradient (#1720)
Browse files Browse the repository at this point in the history
  • Loading branch information
willschlitzer authored Feb 15, 2022
1 parent b1801da commit b16d10d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions pygmt/src/grdgradient.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,21 @@ def grdgradient(grid, **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
>>> # Load a grid of @earth_relief_30m data, with an x-range of 10 to 30,
>>> # and a y-range of 15 to 25
>>> grid = pygmt.datasets.load_earth_relief(
... resolution="30m", region=[10, 30, 15, 25]
... ) # doctest: +SKIP
>>> # Create a new grid from an input grid, set the azimuth to 10 degrees,
>>> # and the direction to "c" for Cartesian coordinates
>>> new_grid = pygmt.grdgradient(
... grid=grid, azimuth=10, direction="c"
... ) # doctest: +SKIP
"""
with GMTTempFile(suffix=".nc") as tmpfile:
if "Q" in kwargs and "N" not in kwargs:
Expand Down

0 comments on commit b16d10d

Please sign in to comment.