2121
2222@fmt_docstring
2323@use_alias (
24- A = "area_thresh" ,
25- C = "lakes" ,
26- E = "dcw" ,
27- I = "rivers" ,
28- L = "map_scale" ,
29- N = "borders" ,
30- W = "shorelines" ,
24+ A = "area_thresh" , C = "lakes" , E = "dcw" , L = "map_scale" , N = "borders" , W = "shorelines"
3125)
3226def coast ( # noqa: PLR0913
3327 self ,
@@ -36,6 +30,7 @@ def coast( # noqa: PLR0913
3630 ] = None ,
3731 land : str | None = None ,
3832 water : str | None = None ,
33+ rivers : int | str | Sequence [int | str ] | None = None ,
3934 box : Box | bool = False ,
4035 projection : str | None = None ,
4136 frame : str | Sequence [str ] | bool = False ,
@@ -71,6 +66,7 @@ def coast( # noqa: PLR0913
7166 - D = resolution
7267 - F = box
7368 - G = land
69+ - I = rivers
7470 - J = projection
7571 - R = region
7672 - S = water
@@ -103,35 +99,43 @@ def coast( # noqa: PLR0913
10399 Select filling of "dry" areas.
104100 water
105101 Select filling of "wet" areas.
106- rivers : int, str, or list
107- *river*\ [/*pen*].
108- Draw rivers. Specify the type of rivers and [optionally] append
109- pen attributes [Default is ``"0.25p,black,solid"``].
110-
111- Choose from the list of river types below; pass a list to ``rivers``
112- to use multiple arguments.
113-
114- - ``0``: double-lined rivers (river-lakes)
115- - ``1``: permanent major rivers
116- - ``2``: additional major rivers
117- - ``3``: additional rivers
118- - ``4``: minor rivers
119- - ``5``: intermittent rivers - major
120- - ``6``: intermittent rivers - additional
121- - ``7``: intermittent rivers - minor
122- - ``8``: major canals
123- - ``9``: minor canals
124- - ``10``: irrigation canals
125-
126- You can also choose from several preconfigured river groups:
127-
128- - ``"a"``: rivers and canals (``0`` - ``10``)
129- - ``"A"``: rivers and canals except river-lakes (``1`` - ``10``)
130- - ``"r"``: permanent rivers (``0`` - ``4``)
131- - ``"R"``: permanent rivers except river-lakes (``1`` - ``4``)
132- - ``"i"``: intermittent rivers (``5`` - ``7``)
133- - ``"c"``: canals (``8`` - ``10``)
134-
102+ rivers
103+ Draw rivers. Specify the type of rivers to draw, and optionally append a pen
104+ attribute, in the format *river*\ /*pen* [Default pen is
105+ ``"0.25p,black,solid"``]. Pass a sequence of river types or *river*\ /*pen*
106+ strings to draw different river types with different pens.
107+
108+ Choose from the following river types:
109+
110+ - ``0``: Double-lined rivers (river-lakes)
111+ - ``1``: Permanent major rivers
112+ - ``2``: Additional major rivers
113+ - ``3``: Additional rivers
114+ - ``4``: Minor rivers
115+ - ``5``: Intermittent rivers - major
116+ - ``6``: Intermittent rivers - additional
117+ - ``7``: Intermittent rivers - minor
118+ - ``8``: Major canals
119+ - ``9``: Minor canals
120+ - ``10``: Irrigation canals
121+
122+ Or choose from the following preconfigured river groups:
123+
124+ - ``"a"``: All rivers and canals (types ``0`` - ``10``)
125+ - ``"A"``: Rivers and canals except river-lakes (types ``1`` - ``10``)
126+ - ``"r"``: Permanent rivers (types ``0`` - ``4``)
127+ - ``"R"``: Permanent rivers except river-lakes (types ``1`` - ``4``)
128+ - ``"i"``: Intermittent rivers (types ``5`` - ``7``)
129+ - ``"c"``: Canals (types ``8`` - ``10``)
130+
131+ Example usage:
132+
133+ - ``rivers=1``: Draw permanent major rivers with default pen.
134+ - ``rivers="1/0.5p,blue"``: Draw permanent major rivers with a 0.5-point blue
135+ pen.
136+ - ``rivers=["1/0.5p,blue", "5/0.3p,cyan,dashed"]``: Draw permanent major rivers
137+ with a 0.5-point blue pen and intermittent major rivers with a 0.3-point
138+ dashed cyan pen.
135139 map_scale : str
136140 [**g**\|\ **j**\|\ **J**\|\ **n**\|\ **x**]\ *refpoint*\ **+w**\ *length*.
137141 Draw a simple map scale centered on the reference point specified.
@@ -207,11 +211,12 @@ def coast( # noqa: PLR0913
207211 if (
208212 kwargs .get ("G" , land ) is None
209213 and kwargs .get ("S" , water ) is None
210- and not args_in_kwargs (args = ["C" , "I" , "N" , "E" , "Q" , "W" ], kwargs = kwargs )
214+ and kwargs .get ("I" , rivers ) is None
215+ and not args_in_kwargs (args = ["C" , "N" , "E" , "Q" , "W" ], kwargs = kwargs )
211216 ):
212217 msg = (
213218 "At least one of the following parameters must be specified: "
214- "land, water, lakes, rivers , borders, dcw, Q, or shorelines."
219+ "land, water, rivers, lakes , borders, dcw, Q, or shorelines."
215220 )
216221 raise GMTInvalidInput (msg )
217222
@@ -230,6 +235,7 @@ def coast( # noqa: PLR0913
230235 ),
231236 F = Alias (box , name = "box" ),
232237 G = Alias (land , name = "land" ),
238+ I = Alias (rivers , name = "rivers" ),
233239 S = Alias (water , name = "water" ),
234240 ).add_common (
235241 B = frame ,
0 commit comments