Skip to content

Commit c9e525f

Browse files
committed
add the same if statment to plot3d.py
1 parent 2d3e197 commit c9e525f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

pygmt/src/plot3d.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,18 @@ def plot3d(
177177
extra_arrays = []
178178
if "S" in kwargs and kwargs["S"][0] in "vV" and direction is not None:
179179
extra_arrays.extend(direction)
180+
if (
181+
"S" not in kwargs and kind == "file"
182+
): # chacking that the data is a file path to set defualt style
183+
try:
184+
with open(pygmt.which(data), "r") as file:
185+
line = file.readline()
186+
if (
187+
"@GMULTIPOINT" in line or "@GPOINT" in line
188+
): # if the file is gmt style and geometry is set to Point
189+
kwargs["S"] = "u0.2c"
190+
except FileNotFoundError:
191+
pas
180192
if "G" in kwargs and not isinstance(kwargs["G"], str):
181193
if kind != "vectors":
182194
raise GMTInvalidInput(

0 commit comments

Comments
 (0)