From a40a075226b1ffc3a0596d4a525521f23ac38c43 Mon Sep 17 00:00:00 2001 From: Will Schlitzer Date: Tue, 5 Jan 2021 07:32:14 +0000 Subject: [PATCH] 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 * Update pygmt/base_plotting.py Co-authored-by: Dongdong Tian * Fixing doc string length Co-authored-by: Dongdong Tian --- pygmt/base_plotting.py | 12 +++++++++--- pygmt/tests/test_coast.py | 2 ++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/pygmt/base_plotting.py b/pygmt/base_plotting.py index fdd63e73c58..1d476650379 100644 --- a/pygmt/base_plotting.py +++ b/pygmt/base_plotting.py @@ -60,6 +60,7 @@ def _preprocess(self, **kwargs): # pylint: disable=no-self-use R="region", J="projection", A="area_thresh", + C="lakes", B="frame", D="resolution", I="rivers", @@ -77,7 +78,7 @@ def _preprocess(self, **kwargs): # pylint: disable=no-self-use ) @kwargs_to_strings(R="sequence", p="sequence") def coast(self, **kwargs): - """ + r""" Plot continents, shorelines, rivers, and borders on maps Plots grayshaded, colored, or textured land-masses [or water-masses] on @@ -110,8 +111,13 @@ def coast(self, **kwargs): hierarchical level that is lower than min_level or higher than max_level will not be plotted. {B} - C : str - Set the shade, color, or pattern for lakes and river-lakes. + lakes : str or list + *fill*\ [**+l**\ |**+r**\ ] + Set the shade, color, or pattern for lakes and river-lakes. The + default is the fill chosen for wet areas set by the ``water`` + argument. Optionally, specify separate fills by appending + **+l** for lakes or **+r** for river-lakes, and passing multiple + strings in a list. resolution : str Selects the resolution of the data set to use ((f)ull, (h)igh, (i)ntermediate, (l)ow, and (c)rude). diff --git a/pygmt/tests/test_coast.py b/pygmt/tests/test_coast.py index 6e93959af4f..db7289c44ea 100644 --- a/pygmt/tests/test_coast.py +++ b/pygmt/tests/test_coast.py @@ -57,6 +57,7 @@ def test_coast_aliases(): Y="a10c", p="135/25", t=13, + C="blue", ) fig_test.coast( region=[-30, 30, -40, 40], # R @@ -74,6 +75,7 @@ def test_coast_aliases(): yshift="a10c", # Y perspective=[135, 25], # p transparency=13, # t + lakes="blue", # C ) return fig_ref, fig_test