Skip to content

Commit b4a94d7

Browse files
Figure.meca: Deprecate parameter labelbox to label_box (Will be removed in v0.20.0) (#4274)
1 parent c588b02 commit b4a94d7

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

examples/tutorials/advanced/focal_mechanisms.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -284,13 +284,13 @@
284284
# parameter. Additionally, the location of the label relative to the beachball [Default
285285
# is ``"TC"``, i.e., Top Center] can be changed by appending **+j** and an offset can
286286
# be applied by appending **+o** with values for *dx*\ /*dy*. Add a colored [Default is
287-
# white] box behind the label via the label ``labelbox``. Force a fixed size of the
287+
# white] box behind the label via the parameter ``label_box``. Force a fixed size of the
288288
# beachball by appending **+m** to the argument passed to the ``scale`` parameter.
289289

290290
fig = pygmt.Figure()
291291
fig.coast(region="d", projection="N10c", land="lightgray", frame=True)
292292

293-
fig.meca(spec=aki_multiple, scale="0.4c+m+f5p", labelbox="white@30", offset="+s0.1c")
293+
fig.meca(spec=aki_multiple, scale="0.4c+m+f5p", label_box="white@30", offset="+s0.1c")
294294

295295
fig.show()
296296

@@ -315,7 +315,7 @@
315315
spec=aki_multiple,
316316
scale="0.4c+f5p",
317317
offset="0.2p,gray30+s0.1c",
318-
labelbox="white@30",
318+
label_box="white@30",
319319
cmap=True,
320320
outline="0.2p,gray30",
321321
)

pygmt/src/meca.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ def _auto_offset(spec) -> bool:
116116

117117

118118
@fmt_docstring
119+
@deprecate_parameter("labelbox", "label_box", "v0.18.0", remove_version="v0.20.0")
119120
@deprecate_parameter(
120121
"extensionfill", "extension_fill", "v0.18.0", remove_version="v0.20.0"
121122
)
@@ -126,7 +127,7 @@ def _auto_offset(spec) -> bool:
126127
A="offset",
127128
C="cmap",
128129
E="extension_fill",
129-
Fr="labelbox",
130+
Fr="label_box",
130131
G="compression_fill",
131132
L="outline",
132133
T="nodal",
@@ -297,7 +298,7 @@ def meca( # noqa: PLR0913
297298
length must match the number of events. This parameter is only used if ``spec``
298299
is a dictionary or a :class:`pandas.DataFrame`, and it overrides any existing
299300
``event_name`` labels in ``spec``.
300-
labelbox : bool or str
301+
label_box : bool or str
301302
[*fill*].
302303
Draw a box behind the label if given via ``event_name``. Use *fill* to give a
303304
fill color [Default is ``"white"``].

0 commit comments

Comments
 (0)