Skip to content

Commit

Permalink
add the same if statment to plot3d.py
Browse files Browse the repository at this point in the history
  • Loading branch information
yohaimagen committed Aug 18, 2021
1 parent 2d3e197 commit c9e525f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pygmt/src/plot3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,18 @@ def plot3d(
extra_arrays = []
if "S" in kwargs and kwargs["S"][0] in "vV" and direction is not None:
extra_arrays.extend(direction)
if (
"S" not in kwargs and kind == "file"
): # chacking that the data is a file path to set defualt style
try:
with open(pygmt.which(data), "r") as file:
line = file.readline()
if (
"@GMULTIPOINT" in line or "@GPOINT" in line
): # if the file is gmt style and geometry is set to Point
kwargs["S"] = "u0.2c"
except FileNotFoundError:
pas
if "G" in kwargs and not isinstance(kwargs["G"], str):
if kind != "vectors":
raise GMTInvalidInput(
Expand Down

0 comments on commit c9e525f

Please sign in to comment.