From a7ee932e523c10e3bf48b77a4e0daa62a8e634b0 Mon Sep 17 00:00:00 2001 From: Will Schlitzer Date: Wed, 5 Oct 2022 14:52:17 -0400 Subject: [PATCH 1/3] create inline example for grdimage.py --- pygmt/src/grdimage.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pygmt/src/grdimage.py b/pygmt/src/grdimage.py index 1aa4a715b24..c060ffcabb3 100644 --- a/pygmt/src/grdimage.py +++ b/pygmt/src/grdimage.py @@ -12,6 +12,8 @@ use_alias, ) +__doctest_skip__ = ["grdimage"] + @fmt_docstring @use_alias( @@ -161,6 +163,19 @@ def grdimage(self, grid, **kwargs): {perspective} {transparency} {cores} + + Example + ------- + >>> import pygmt + >>> # load the 30m grid with "gridline" registration + >>> grid = load_earth_relief("30m", registration="gridline") + >>> # create a new plot with pygmt.Figure() + >>> fig = pygmt.Figure() + >>> # pass in the grid and set the CPT to "geo" + >>> # set the projection to Mollweide and the size to 10 cm + >>> fig.grdimage(grid=grid, cmap="geo", projection="W10c", frame="ag") + >>> # show the plot + >>> fig.show() """ kwargs = self._preprocess(**kwargs) # pylint: disable=protected-access with Session() as lib: From 52fffa82457f67153f58a7f72e735de83fdd785a Mon Sep 17 00:00:00 2001 From: Will Schlitzer Date: Thu, 6 Oct 2022 07:42:57 -0400 Subject: [PATCH 2/3] fix load_earth_relief --- pygmt/src/grdimage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pygmt/src/grdimage.py b/pygmt/src/grdimage.py index c060ffcabb3..29229690336 100644 --- a/pygmt/src/grdimage.py +++ b/pygmt/src/grdimage.py @@ -168,7 +168,7 @@ def grdimage(self, grid, **kwargs): ------- >>> import pygmt >>> # load the 30m grid with "gridline" registration - >>> grid = load_earth_relief("30m", registration="gridline") + >>> grid = pygmt.datasets.load_earth_relief("30m", registration="gridline") >>> # create a new plot with pygmt.Figure() >>> fig = pygmt.Figure() >>> # pass in the grid and set the CPT to "geo" From db967c73409cf16c54397b85b5de0f91b5087c3b Mon Sep 17 00:00:00 2001 From: Will Schlitzer Date: Sat, 8 Oct 2022 20:50:06 -0400 Subject: [PATCH 3/3] Update pygmt/src/grdimage.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Yvonne Fröhlich <94163266+yvonnefroehlich@users.noreply.github.com> --- pygmt/src/grdimage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pygmt/src/grdimage.py b/pygmt/src/grdimage.py index 29229690336..17378684886 100644 --- a/pygmt/src/grdimage.py +++ b/pygmt/src/grdimage.py @@ -167,7 +167,7 @@ def grdimage(self, grid, **kwargs): Example ------- >>> import pygmt - >>> # load the 30m grid with "gridline" registration + >>> # load the 30 arc minute grid with "gridline" registration >>> grid = pygmt.datasets.load_earth_relief("30m", registration="gridline") >>> # create a new plot with pygmt.Figure() >>> fig = pygmt.Figure()