Skip to content

Commit ff164e6

Browse files
committed
Disable text kwarg for meca for now
1 parent deaa1aa commit ff164e6

File tree

3 files changed

+9
-22
lines changed

3 files changed

+9
-22
lines changed

pygmt/base_plotting.py

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,15 +1009,18 @@ def meca(
10091009
component="full",
10101010
plot_lon=None,
10111011
plot_lat=None,
1012-
text=None,
1013-
text_options="",
10141012
**kwargs,
10151013
):
10161014
"""
10171015
Plot focal mechanisms.
10181016
10191017
Full option list at :gmt-docs:`supplements/seis/meca.html`
10201018
1019+
Note
1020+
----
1021+
Currently, labeling of beachballs with text strings is only
1022+
supported via providing a file to `spec` as input.
1023+
10211024
{aliases}
10221025
10231026
Parameters
@@ -1065,12 +1068,6 @@ def meca(
10651068
plot_lat: int or float
10661069
Latitude at which to place beachball, only used if `spec` is a
10671070
dictionary.
1068-
text: str
1069-
Text string to appear near the beachball, only used if `spec` is a
1070-
dictionary.
1071-
text_options: str
1072-
Options for text labeling of beachballs, in the format
1073-
``[+aangle][+ffont][+jjustify][+odx[/dy]]``
10741071
offset: bool or str
10751072
Offsets beachballs to the longitude, latitude specified in
10761073
the last two columns of the input file or array, or by `plot_lon`
@@ -1153,17 +1150,14 @@ def meca(
11531150

11541151
# Add in plotting options, if given, otherwise add 0s as required
11551152
# by GMT
1156-
for arg in plot_lon, plot_lat, text:
1153+
for arg in plot_lon, plot_lat:
11571154
if arg is None:
11581155
spec.append(0)
11591156
else:
1157+
if "C" not in kwargs:
1158+
kwargs["C"] = True
11601159
spec.append(arg)
11611160

1162-
# If the user gave plot coordinates, make sure the C flag is on
1163-
if plot_lon is not None and plot_lat is not None:
1164-
if "C" not in kwargs:
1165-
kwargs["C"] = True
1166-
11671161
# Add condition and scale to kwargs
11681162
if convention == "aki":
11691163
format = "a"
@@ -1194,7 +1188,7 @@ def meca(
11941188
raise GMTError("Convention not recognized.")
11951189

11961190
# Assemble -S flag
1197-
kwargs["S"] = format + scale + text_options
1191+
kwargs["S"] = format + scale
11981192

11991193
kind = data_kind(spec)
12001194
with Session() as lib:
Loading

pygmt/tests/test_meca.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ def test_meca_spec_dictionary():
9494
region=[-1, 4, 0, 6],
9595
projection="M14c",
9696
frame=2,
97-
text="Right Strike Slip",
9897
)
9998

10099
# Left lateral strike slip
@@ -104,7 +103,6 @@ def test_meca_spec_dictionary():
104103
lat=5,
105104
depth=0,
106105
scale="2.5c",
107-
text="Left Strike Slip",
108106
)
109107

110108
# Thrust
@@ -114,15 +112,13 @@ def test_meca_spec_dictionary():
114112
lat=3,
115113
depth=0,
116114
scale="2.5c",
117-
text="Thrust",
118115
)
119116
fig.meca(
120117
dict(strike=45, dip=45, rake=90, magnitude=5),
121118
lon=2,
122119
lat=3,
123120
depth=0,
124121
scale="2.5c",
125-
text="Thrust",
126122
)
127123

128124
# Normal
@@ -132,15 +128,13 @@ def test_meca_spec_dictionary():
132128
lat=1,
133129
depth=0,
134130
scale="2.5c",
135-
text="Normal",
136131
)
137132
fig.meca(
138133
dict(strike=45, dip=45, rake=-90, magnitude=5),
139134
lon=2,
140135
lat=1,
141136
depth=0,
142137
scale="2.5c",
143-
text="Normal",
144138
)
145139

146140
# Mixed
@@ -150,7 +144,6 @@ def test_meca_spec_dictionary():
150144
lat=0.6,
151145
depth=0,
152146
scale="2.5c",
153-
text="Mixed",
154147
)
155148

156149
return fig

0 commit comments

Comments
 (0)