Skip to content

Commit d992964

Browse files
authored
DOC: Update the gallery example for pygmt.grdlandmask (#4434)
1 parent 3657859 commit d992964

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

examples/gallery/images/grdlandmask.py

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
Create 'wet-dry' mask grid
33
==========================
44
5-
The :func:`pygmt.grdlandmask` function allows setting all nodes on land
6-
or water to a specified value using the ``mask_values`` parameter.
5+
The :func:`pygmt.grdlandmask` function allows setting all nodes on land or water to a
6+
specified value using the ``mask_values`` parameter.
77
"""
88

99
# %%
@@ -15,22 +15,20 @@
1515
# Define region of interest
1616
region = [-65, -40, -40, -20]
1717

18-
# Assign a value of 0 for all water masses and a value of 1 for all land
19-
# masses.
20-
# Use shoreline data with (l)ow resolution and set the grid spacing to
21-
# 5 arc-minutes in x- and y-directions.
18+
# Assign a value of 0 for all water masses and a value of 1 for all land masses. Use
19+
# shoreline data with low resolution and set the grid spacing to 5 arc-minutes in x-
20+
# and y-directions.
2221
grid = pygmt.grdlandmask(
23-
region=region, spacing="5m", mask_values=[0, 1], resolution="l"
22+
region=region, spacing="5m", mask_values=[0, 1], resolution="low"
2423
)
2524

2625
# Plot clipped grid
2726
fig.basemap(region=region, projection="M12c", frame=True)
2827

29-
# Define a colormap to be used for two categories, define the range of the
30-
# new discrete CPT using series=(lowest_value, highest_value, interval),
31-
# use color_model="+cwater,land" to write the discrete color palette
32-
# "batlow" in categorical format and add water/land as annotations for the
33-
# colorbar.
28+
# Define a colormap to be used for two categories, define the range of the new discrete
29+
# CPT using series=(low, high, interval), use color_model="+cwater,land" to write the
30+
# discrete color palette "SCM/batlow" in categorical format and add water/land as
31+
# annotations for the colorbar.
3432
pygmt.makecpt(cmap="SCM/batlow", series=(0, 1, 1), color_model="+cwater,land")
3533

3634
fig.grdimage(grid=grid, cmap=True)

0 commit comments

Comments
 (0)