1111
1212
1313@fmt_docstring
14- @use_alias (
15- L = "map_scale" ,
16- F = "box" ,
17- Td = "rose" ,
18- Tm = "compass" ,
19- f = "coltypes" ,
20- )
21- def basemap (
14+ @use_alias (F = "box" , Td = "rose" , Tm = "compass" , f = "coltypes" )
15+ def basemap ( # noqa: PLR0913
2216 self ,
2317 projection : str | None = None ,
2418 zsize : float | str | None = None ,
2519 zscale : float | str | None = None ,
2620 frame : str | Sequence [str ] | bool = False ,
2721 region : Sequence [float | str ] | str | None = None ,
22+ map_scale : str | None = None ,
2823 verbose : Literal ["quiet" , "error" , "warning" , "timing" , "info" , "compat" , "debug" ]
2924 | bool = False ,
3025 panel : int | Sequence [int ] | bool = False ,
@@ -35,13 +30,17 @@ def basemap(
3530 r"""
3631 Plot base maps and frames.
3732
38- Creates a basic or fancy basemap with axes, fill, and titles. Several
39- map projections are available, and the user may specify separate
40- tick-mark intervals for boundary annotation, ticking, and [optionally]
41- gridlines. A simple map scale or directional rose may also be plotted.
33+ Creates a basic or fancy basemap with axes, fill, and titles. Several map
34+ projections are available, and the user may specify separate tick-mark intervals for
35+ boundary annotation, ticking, and [optionally] gridlines.
4236
43- At least one of the parameters ``frame``, ``map_scale``, ``rose``, or
44- ``compass`` must be specified if not in subplot mode.
37+ At least one of the parameters ``frame``, ``map_scale``, ``rose``, or ``compass``
38+ must be specified if not in subplot mode.
39+
40+ See also the following methods that provide higher-level interfaces to the GMT's
41+ ``basemap`` module:
42+
43+ - :meth:`pygmt.Figure.scalebar`: Add a scale bar on the plot.
4544
4645 Full GMT docs at :gmt-docs:`basemap.html`.
4746
@@ -50,6 +49,7 @@ def basemap(
5049 - J = projection
5150 - Jz = zscale
5251 - JZ = zsize
52+ - L = map_scale
5353 - R = region
5454 - V = verbose
5555 - c = panel
@@ -64,10 +64,15 @@ def basemap(
6464 $region
6565 *Required if this is the first plot command.*
6666 $frame
67- map_scale : str
68- [**g**\|\ **j**\|\ **J**\|\ **n**\|\ **x**]\ *refpoint*\
69- **+w**\ *length*.
70- Draw a simple map scale centered on the reference point specified.
67+ map_scale
68+ Draw a map scale bar on the plot.
69+
70+ .. deprecated:: v0.19.0
71+
72+ This parameter is deprecated. Use :meth:`pygmt.Figure.scalebar` instead,
73+ which provides a more comprehensive and flexible API for adding scale bars
74+ to plots. This parameter still accepts raw GMT CLI strings for the ``-L``
75+ option of the ``basemap`` module for backward compatibility.
7176 box : bool or str
7277 [**+c**\ *clearances*][**+g**\ *fill*][**+i**\ [[*gap*/]\ *pen*]]\
7378 [**+p**\ [*pen*]][**+r**\ [*radius*]][**+s**\ [[*dx*/*dy*/][*shade*]]].
@@ -103,6 +108,7 @@ def basemap(
103108 aliasdict = AliasSystem (
104109 Jz = Alias (zscale , name = "zscale" ),
105110 JZ = Alias (zsize , name = "zsize" ),
111+ L = Alias (map_scale , name = "map_scale" ), # Deprecated.
106112 ).add_common (
107113 B = frame ,
108114 J = projection ,
0 commit comments