From 73f46df7aa6efe24dcf2a125877f96bd3db546ed Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Sat, 28 Feb 2026 13:55:36 +0800 Subject: [PATCH] DOC: Update the gallery example for pygmt.grdlandmask --- examples/gallery/images/grdlandmask.py | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/examples/gallery/images/grdlandmask.py b/examples/gallery/images/grdlandmask.py index 808c2375aa8..7c85eef73e9 100644 --- a/examples/gallery/images/grdlandmask.py +++ b/examples/gallery/images/grdlandmask.py @@ -2,8 +2,8 @@ Create 'wet-dry' mask grid ========================== -The :func:`pygmt.grdlandmask` function allows setting all nodes on land -or water to a specified value using the ``mask_values`` parameter. +The :func:`pygmt.grdlandmask` function allows setting all nodes on land or water to a +specified value using the ``mask_values`` parameter. """ # %% @@ -15,22 +15,20 @@ # Define region of interest region = [-65, -40, -40, -20] -# Assign a value of 0 for all water masses and a value of 1 for all land -# masses. -# Use shoreline data with (l)ow resolution and set the grid spacing to -# 5 arc-minutes in x- and y-directions. +# Assign a value of 0 for all water masses and a value of 1 for all land masses. Use +# shoreline data with low resolution and set the grid spacing to 5 arc-minutes in x- +# and y-directions. grid = pygmt.grdlandmask( - region=region, spacing="5m", mask_values=[0, 1], resolution="l" + region=region, spacing="5m", mask_values=[0, 1], resolution="low" ) # Plot clipped grid fig.basemap(region=region, projection="M12c", frame=True) -# Define a colormap to be used for two categories, define the range of the -# new discrete CPT using series=(lowest_value, highest_value, interval), -# use color_model="+cwater,land" to write the discrete color palette -# "batlow" in categorical format and add water/land as annotations for the -# colorbar. +# Define a colormap to be used for two categories, define the range of the new discrete +# CPT using series=(low, high, interval), use color_model="+cwater,land" to write the +# discrete color palette "SCM/batlow" in categorical format and add water/land as +# annotations for the colorbar. pygmt.makecpt(cmap="SCM/batlow", series=(0, 1, 1), color_model="+cwater,land") fig.grdimage(grid=grid, cmap=True)