Skip to content

Commit a40a075

Browse files
Add lakes alias to Figure.coast() (#781)
* Add lakes alias to coast in base_plotting.py * Changing color to fill * Update coast docstring to r-string and change line lengths * Add test for lake alias to test_coast.py * Run make format * Update pygmt/base_plotting.py Co-authored-by: Dongdong Tian <[email protected]> * Update pygmt/base_plotting.py Co-authored-by: Dongdong Tian <[email protected]> * Fixing doc string length Co-authored-by: Dongdong Tian <[email protected]>
1 parent 7181cf1 commit a40a075

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

pygmt/base_plotting.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ def _preprocess(self, **kwargs): # pylint: disable=no-self-use
6060
R="region",
6161
J="projection",
6262
A="area_thresh",
63+
C="lakes",
6364
B="frame",
6465
D="resolution",
6566
I="rivers",
@@ -77,7 +78,7 @@ def _preprocess(self, **kwargs): # pylint: disable=no-self-use
7778
)
7879
@kwargs_to_strings(R="sequence", p="sequence")
7980
def coast(self, **kwargs):
80-
"""
81+
r"""
8182
Plot continents, shorelines, rivers, and borders on maps
8283
8384
Plots grayshaded, colored, or textured land-masses [or water-masses] on
@@ -110,8 +111,13 @@ def coast(self, **kwargs):
110111
hierarchical level that is lower than min_level or higher than
111112
max_level will not be plotted.
112113
{B}
113-
C : str
114-
Set the shade, color, or pattern for lakes and river-lakes.
114+
lakes : str or list
115+
*fill*\ [**+l**\ |**+r**\ ]
116+
Set the shade, color, or pattern for lakes and river-lakes. The
117+
default is the fill chosen for wet areas set by the ``water``
118+
argument. Optionally, specify separate fills by appending
119+
**+l** for lakes or **+r** for river-lakes, and passing multiple
120+
strings in a list.
115121
resolution : str
116122
Selects the resolution of the data set to use ((f)ull, (h)igh,
117123
(i)ntermediate, (l)ow, and (c)rude).

pygmt/tests/test_coast.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ def test_coast_aliases():
5757
Y="a10c",
5858
p="135/25",
5959
t=13,
60+
C="blue",
6061
)
6162
fig_test.coast(
6263
region=[-30, 30, -40, 40], # R
@@ -74,6 +75,7 @@ def test_coast_aliases():
7475
yshift="a10c", # Y
7576
perspective=[135, 25], # p
7677
transparency=13, # t
78+
lakes="blue", # C
7779
)
7880
return fig_ref, fig_test
7981

0 commit comments

Comments
 (0)