From abd44f812ad3637f65794d364f4339e914811621 Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Thu, 25 Jul 2024 11:33:30 +0200 Subject: [PATCH 1/3] Add alias and docstring for 'T' of 'grdview' --- pygmt/src/grdview.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pygmt/src/grdview.py b/pygmt/src/grdview.py index 5e6256a0b1f..cbe635a2dac 100644 --- a/pygmt/src/grdview.py +++ b/pygmt/src/grdview.py @@ -23,6 +23,7 @@ Wm="meshpen", Wf="facadepen", I="shading", + T="no_interpolation", V="verbose", c="panel", f="coltypes", @@ -103,6 +104,16 @@ def grdview(self, grid, **kwargs): specify azimuth, intensity, and ambient arguments for that function, or just give **+d** to select the default arguments [Default is **+a**\ -45\ **+nt**\ 1\ **+m**\ 0]. + no_interpolation : bool or str + [**+o**\ [*pen*\ ]][**+s**]. + Plot without any interpolation. This involves converting each node- + centered bin into a polygon which is then painted separately. Append **+s** + to skip nodes with z = NaN. This option is suitable for categorical data + where interpolating between values is meaningless and a categorical CPT + has been provided via ``cmap``. Optionally, append **+o** to draw the tile + outlines, and specify a custom pen if the default pen is not to your liking. + As this option produces a flat surface it cannot be combined with ``zscale`` + or ``zsize``. {verbose} {panel} {coltypes} From 28bf9143f50d834fea502db0e4f45bdad0f7b435 Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Thu, 25 Jul 2024 15:15:21 +0200 Subject: [PATCH 2/3] Add alias 'no_interpolation' for '-T' of 'grdimage' --- pygmt/src/grdimage.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pygmt/src/grdimage.py b/pygmt/src/grdimage.py index a1ba783ab6c..fbe1e4b91e3 100644 --- a/pygmt/src/grdimage.py +++ b/pygmt/src/grdimage.py @@ -27,6 +27,7 @@ N="no_clip", Q="nan_transparent", R="region", + T="no_interpolation", V="verbose", n="interpolation", c="panel", @@ -132,6 +133,16 @@ def grdimage(self, grid, **kwargs): 3). If the input is a grid, use **+z** to select another grid value than NaN. If input is instead an image, append an alternate *color* to select another pixel value to be transparent [Default is ``"black"``]. + no_interpolation : bool or str + [**+o**\ [*pen*\ ]][**+s**]. + Plot without any interpolation. This involves converting each node- + centered bin into a polygon which is then painted separately. Append **+s** + to skip nodes with z = NaN. This option is suitable for categorical data + where interpolating between values is meaningless and a categorical CPT + has been provided via ``cmap``. Optionally, append **+o** to draw the tile + outlines, and specify a custom pen if the default pen is not to your liking. + As this option produces a flat surface it cannot be combined with ``zscale`` + or ``zsize``. {region} {verbose} {panel} From 5035c390d6f71e5f44db6d1669fd444fd550b5bc Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Thu, 25 Jul 2024 17:14:17 +0200 Subject: [PATCH 3/3] Improve docstrings --- pygmt/src/grdimage.py | 6 ++---- pygmt/src/grdview.py | 7 +++---- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/pygmt/src/grdimage.py b/pygmt/src/grdimage.py index fbe1e4b91e3..e3158565c77 100644 --- a/pygmt/src/grdimage.py +++ b/pygmt/src/grdimage.py @@ -139,10 +139,8 @@ def grdimage(self, grid, **kwargs): centered bin into a polygon which is then painted separately. Append **+s** to skip nodes with z = NaN. This option is suitable for categorical data where interpolating between values is meaningless and a categorical CPT - has been provided via ``cmap``. Optionally, append **+o** to draw the tile - outlines, and specify a custom pen if the default pen is not to your liking. - As this option produces a flat surface it cannot be combined with ``zscale`` - or ``zsize``. + has been provided via ``cmap``. Append **+o** to draw the tile outlines, + and specify a custom pen. {region} {verbose} {panel} diff --git a/pygmt/src/grdview.py b/pygmt/src/grdview.py index cbe635a2dac..03a9d5c8c59 100644 --- a/pygmt/src/grdview.py +++ b/pygmt/src/grdview.py @@ -110,10 +110,9 @@ def grdview(self, grid, **kwargs): centered bin into a polygon which is then painted separately. Append **+s** to skip nodes with z = NaN. This option is suitable for categorical data where interpolating between values is meaningless and a categorical CPT - has been provided via ``cmap``. Optionally, append **+o** to draw the tile - outlines, and specify a custom pen if the default pen is not to your liking. - As this option produces a flat surface it cannot be combined with ``zscale`` - or ``zsize``. + has been provided via ``cmap``. Append **+o** to draw the tile outlines, + and specify a custom pen. As this option produces a flat surface it cannot + be combined with ``zscale`` or ``zsize``. {verbose} {panel} {coltypes}