diff --git a/pygmt/src/grdtrack.py b/pygmt/src/grdtrack.py index 6e0e6d91431..1f15161b99c 100644 --- a/pygmt/src/grdtrack.py +++ b/pygmt/src/grdtrack.py @@ -12,6 +12,8 @@ use_alias, ) +__doctest_skip__ = ["grdtrack"] + @fmt_docstring @use_alias( @@ -264,6 +266,22 @@ def grdtrack(points, grid, newcolname=None, outfile=None, **kwargs): ``outfile`` is not set - None if ``outfile`` is set (track output will be stored in file set by ``outfile``) + + Example + ------- + >>> import pygmt + >>> # Load a grid of @earth_relief_30m data, with an x-range of -118 to + >>> # -107, and a y-range of -49 to -42 + >>> grid = pygmt.datasets.load_earth_relief( + ... resolution="30m", region=[-118, -107, -49, -42] + ... ) + >>> # Load a pandas dataframe with ocean ridge points + >>> points = pygmt.datasets.load_sample_data(name="ocean_ridge_points") + >>> # Create a pandas dataframe from an input grid and set of points + >>> # The output dataframe adds a column named "bathymetry" + >>> output_dataframe = pygmt.grdtrack( + ... points=points, grid=grid, newcolname="bathymetry" + ... ) """ if hasattr(points, "columns") and newcolname is None: raise GMTInvalidInput("Please pass in a str to 'newcolname'")