88
99from pygmt .alias import Alias , AliasSystem
1010from pygmt .clib import Session
11- from pygmt .helpers import build_arg_list , fmt_docstring , kwargs_to_strings , use_alias
11+ from pygmt .helpers import (
12+ build_arg_list ,
13+ deprecate_parameter ,
14+ fmt_docstring ,
15+ kwargs_to_strings ,
16+ use_alias ,
17+ )
1218from pygmt .params import Box
1319
1420__doctest_skip__ = ["inset" ]
1521
1622
1723@fmt_docstring
24+ @deprecate_parameter ("margin" , "clearance" , "v0.18.0" , remove_version = "v0.20.0" )
1825@contextlib .contextmanager
19- @use_alias (D = "position" , M = "margin " )
26+ @use_alias (D = "position" , C = "clearance " )
2027@kwargs_to_strings (D = "sequence" , M = "sequence" )
2128def inset (
2229 self ,
@@ -90,7 +97,7 @@ def inset(
9097 box is drawn using :gmt-term:`MAP_FRAME_PEN`. To customize the box appearance,
9198 pass a :class:`pygmt.params.Box` object to control style, fill, pen, and other
9299 box properties.
93- margin : float, str, or list
100+ clearance : float, str, or list
94101 This is clearance that is added around the inside of the inset.
95102 Plotting will take place within the inner region only. The margins
96103 can be a single value, a pair of values separated (for setting
@@ -116,7 +123,7 @@ def inset(
116123 >>> fig.coast(region="MG+r2", water="lightblue", shorelines="thin")
117124 >>> # Use a "with" statement to initialize the inset context manager
118125 >>> # Setting the position to Top Left and a width of 3.5 centimeters
119- >>> with fig.inset(position="jTL+w3.5c+o0.2c", margin =0, box=Box(pen="green")):
126+ >>> with fig.inset(position="jTL+w3.5c+o0.2c", clearance =0, box=Box(pen="green")):
120127 ... # Map elements under the "with" statement are plotted in the inset
121128 ... fig.coast(
122129 ... region="g",
0 commit comments