Skip to content

Commit

Permalink
Disable text kwarg for meca for now
Browse files Browse the repository at this point in the history
  • Loading branch information
liamtoney committed Jul 13, 2020
1 parent deaa1aa commit ff164e6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 22 deletions.
24 changes: 9 additions & 15 deletions pygmt/base_plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -1009,15 +1009,18 @@ def meca(
component="full",
plot_lon=None,
plot_lat=None,
text=None,
text_options="",
**kwargs,
):
"""
Plot focal mechanisms.
Full option list at :gmt-docs:`supplements/seis/meca.html`
Note
----
Currently, labeling of beachballs with text strings is only
supported via providing a file to `spec` as input.
{aliases}
Parameters
Expand Down Expand Up @@ -1065,12 +1068,6 @@ def meca(
plot_lat: int or float
Latitude at which to place beachball, only used if `spec` is a
dictionary.
text: str
Text string to appear near the beachball, only used if `spec` is a
dictionary.
text_options: str
Options for text labeling of beachballs, in the format
``[+aangle][+ffont][+jjustify][+odx[/dy]]``
offset: bool or str
Offsets beachballs to the longitude, latitude specified in
the last two columns of the input file or array, or by `plot_lon`
Expand Down Expand Up @@ -1153,17 +1150,14 @@ def meca(

# Add in plotting options, if given, otherwise add 0s as required
# by GMT
for arg in plot_lon, plot_lat, text:
for arg in plot_lon, plot_lat:
if arg is None:
spec.append(0)
else:
if "C" not in kwargs:
kwargs["C"] = True
spec.append(arg)

# If the user gave plot coordinates, make sure the C flag is on
if plot_lon is not None and plot_lat is not None:
if "C" not in kwargs:
kwargs["C"] = True

# Add condition and scale to kwargs
if convention == "aki":
format = "a"
Expand Down Expand Up @@ -1194,7 +1188,7 @@ def meca(
raise GMTError("Convention not recognized.")

# Assemble -S flag
kwargs["S"] = format + scale + text_options
kwargs["S"] = format + scale

kind = data_kind(spec)
with Session() as lib:
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 0 additions & 7 deletions pygmt/tests/test_meca.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ def test_meca_spec_dictionary():
region=[-1, 4, 0, 6],
projection="M14c",
frame=2,
text="Right Strike Slip",
)

# Left lateral strike slip
Expand All @@ -104,7 +103,6 @@ def test_meca_spec_dictionary():
lat=5,
depth=0,
scale="2.5c",
text="Left Strike Slip",
)

# Thrust
Expand All @@ -114,15 +112,13 @@ def test_meca_spec_dictionary():
lat=3,
depth=0,
scale="2.5c",
text="Thrust",
)
fig.meca(
dict(strike=45, dip=45, rake=90, magnitude=5),
lon=2,
lat=3,
depth=0,
scale="2.5c",
text="Thrust",
)

# Normal
Expand All @@ -132,15 +128,13 @@ def test_meca_spec_dictionary():
lat=1,
depth=0,
scale="2.5c",
text="Normal",
)
fig.meca(
dict(strike=45, dip=45, rake=-90, magnitude=5),
lon=2,
lat=1,
depth=0,
scale="2.5c",
text="Normal",
)

# Mixed
Expand All @@ -150,7 +144,6 @@ def test_meca_spec_dictionary():
lat=0.6,
depth=0,
scale="2.5c",
text="Mixed",
)

return fig

0 comments on commit ff164e6

Please sign in to comment.