1111
1212
1313@fmt_docstring
14- @use_alias (F = "box" , f = "coltypes" )
14+ @use_alias (f = "coltypes" )
1515def basemap ( # noqa: PLR0913
1616 self ,
1717 projection : str | None = None ,
@@ -22,29 +22,35 @@ def basemap( # noqa: PLR0913
2222 map_scale : str | None = None ,
2323 compass : str | None = None ,
2424 rose : str | None = None ,
25+ box : str | bool = False ,
2526 verbose : Literal ["quiet" , "error" , "warning" , "timing" , "info" , "compat" , "debug" ]
2627 | bool = False ,
2728 panel : int | Sequence [int ] | bool = False ,
2829 transparency : float | None = None ,
2930 perspective : float | Sequence [float ] | str | bool = False ,
3031 ** kwargs ,
3132):
32- r """
33+ """
3334 Plot base maps and frames.
3435
3536 Creates a basic or fancy basemap with axes, fill, and titles. Several map
36- projections are available, and the user may specify separate tick-mark intervals for
37- boundary annotation, ticking, and [optionally] gridlines.
37+ projections are available, and separate tick-mark intervals for axis annotation,
38+ ticking, and gridlines can be specified.
39+
40+ If not in subplot mode (see :meth:`pygmt.Figure.subplot`), at least one of the
41+ parameters ``frame``, ``map_scale``, ``rose``, or ``compass`` must be specified.
42+
43+ .. note::
3844
39- At least one of the parameters ``frame ``, ``map_scale ``, ``rose ``, or ``compass``
40- must be specified if not in subplot mode.
45+ Parameters ``map_scale ``, ``rose ``, ``compass ``, and ``box`` are deprecated in
46+ favor of the dedicated higher-level methods:
4147
42- See also the following methods that provide higher-level interfaces to the GMT's
43- ``basemap`` module:
48+ - :meth:`pygmt.Figure.scalebar`: Add a scale bar on the plot.
49+ - :meth:`pygmt.Figure.directional_rose`: Add a directional rose on the plot.
50+ - :meth:`pygmt.Figure.magnetic_rose`: Add a magnetic rose on the plot.
4451
45- - :meth:`pygmt.Figure.scalebar`: Add a scale bar on the plot.
46- - :meth:``pygmt.Figure.directional_rose`: Add a directional rose on the plot.
47- - :meth:`pygmt.Figure.magnetic_rose`: Add a magnetic rose on the plot.
52+ These methods provide more comprehensive and flexible APIs for their respective
53+ plot elements.
4854
4955 Full GMT docs at :gmt-docs:`basemap.html`.
5056
@@ -64,7 +70,8 @@ def basemap( # noqa: PLR0913
6470 Parameters
6571 ----------
6672 $projection
67- zscale/zsize
73+ zscale
74+ zsize
6875 Set z-axis scaling or z-axis size.
6976 $region
7077 *Required if this is the first plot command.*
@@ -74,46 +81,34 @@ def basemap( # noqa: PLR0913
7481
7582 .. deprecated:: v0.19.0
7683
77- This parameter is deprecated. Use :meth:`pygmt.Figure.scalebar` instead,
78- which provides a more comprehensive and flexible API for adding scale bars
79- to plots. This parameter still accepts raw GMT CLI strings for the ``-L``
80- option of the ``basemap`` module for backward compatibility.
84+ Use :meth:`pygmt.Figure.scalebar` instead. This parameter is maintained
85+ for backward compatibility and accepts raw GMT CLI strings for the ``-L``
86+ option.
8187 compass
8288 Draw a map magnetic rose on the map.
8389
8490 .. deprecated:: v0.19.0
8591
86- This parameter is deprecated. Use :meth:`pygmt.Figure.magnetic_rose`
87- instead, which provides a more comprehensive and flexible API for adding
88- magnetic roses to plots. This parameter still accepts raw GMT CLI strings
89- for the ``-Tm`` option of the ``basemap`` module for backward compatibility.
92+ Use :meth:`pygmt.Figure.magnetic_rose` instead. This parameter is maintained
93+ for backward compatibility and accepts raw GMT CLI strings for the ``-Tm``
94+ option.
9095 rose
9196 Draw a map directional rose on the map.
9297
9398 .. deprecated:: v0.19.0
9499
95- This parameter is deprecated. Use :meth:`pygmt.Figure.directional_rose`
96- instead, which provides a more comprehensive and flexible API for adding
97- directional roses. This parameter still accepts raw GMT CLI strings for the
98- ``-Td`` option of the ``basemap`` module for backward compatibility.
99- box : bool or str
100- [**+c**\ *clearances*][**+g**\ *fill*][**+i**\ [[*gap*/]\ *pen*]]\
101- [**+p**\ [*pen*]][**+r**\ [*radius*]][**+s**\ [[*dx*/*dy*/][*shade*]]].
102- If set to ``True``, draw a rectangular border around the
103- map scale or rose. Alternatively, specify a different pen with
104- **+p**\ *pen*. Add **+g**\ *fill* to fill the scale panel [Default is
105- no fill]. Append **+c**\ *clearance* where *clearance* is either gap,
106- xgap/ygap, or lgap/rgap/bgap/tgap where these items are uniform,
107- separate x and y, or individual side spacings between scale and
108- border. Append **+i** to draw a secondary, inner border as well.
109- We use a uniform gap between borders of 2 points and the
110- :gmt-term:`MAP_DEFAULTS_PEN` unless other values are specified. Append
111- **+r** to draw rounded rectangular borders instead, with a 6-points
112- corner radius. You can override this radius by appending another value.
113- Finally, append **+s** to draw an offset background shaded region.
114- Here, *dx/dy* indicates the shift relative to the foreground frame
115- [Default is ``"4p/-4p"``] and shade sets the fill style to use for
116- shading [Default is ``"gray50"``].
100+ Use :meth:`pygmt.Figure.directional_rose` instead. This parameter is
101+ maintained for backward compatibility and accepts raw GMT CLI strings for
102+ the ``-Td`` option.
103+ box
104+ Draw a background box behind the scalebar, directional rose, or magnetic rose.
105+
106+ .. deprecated:: v0.19.0
107+
108+ Use the ``box`` parameter in :meth:`pygmt.Figure.scalebar`,
109+ :meth:`pygmt.Figure.directional_rose`, or :meth:`pygmt.Figure.magnetic_rose`
110+ instead. This parameter is maintained for backward compatibility and accepts
111+ raw GMT CLI strings for the ``-F`` option.
117112 $verbose
118113 $panel
119114 $coltypes
@@ -123,6 +118,7 @@ def basemap( # noqa: PLR0913
123118 self ._activate_figure ()
124119
125120 aliasdict = AliasSystem (
121+ F = Alias (box , name = "box" ), # Deprecated.
126122 Jz = Alias (zscale , name = "zscale" ),
127123 JZ = Alias (zsize , name = "zsize" ),
128124 L = Alias (map_scale , name = "map_scale" ), # Deprecated.
0 commit comments