From 763dc07931ebe597a4466ff30717195023e50f11 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Tue, 12 Nov 2024 06:38:08 +0800 Subject: [PATCH] Figure.plot/Figure.plot3d: Improve the check of the "style" parameter for "v" or "V" (#3603) --- pygmt/src/plot.py | 3 ++- pygmt/src/plot3d.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pygmt/src/plot.py b/pygmt/src/plot.py index 1cad190c8ee..2767da138d2 100644 --- a/pygmt/src/plot.py +++ b/pygmt/src/plot.py @@ -213,7 +213,8 @@ def plot( if kind == "empty": # Add more columns for vectors input # Parameters for vector styles if ( - kwargs.get("S") is not None + isinstance(kwargs.get("S"), str) + and len(kwargs["S"]) >= 1 and kwargs["S"][0] in "vV" and is_nonstr_iter(direction) ): diff --git a/pygmt/src/plot3d.py b/pygmt/src/plot3d.py index 60dac2d5d37..3a070a53b52 100644 --- a/pygmt/src/plot3d.py +++ b/pygmt/src/plot3d.py @@ -197,7 +197,8 @@ def plot3d( if kind == "empty": # Add more columns for vectors input # Parameters for vector styles if ( - kwargs.get("S") is not None + isinstance(kwargs.get("S"), str) + and len(kwargs["S"]) >= 1 and kwargs["S"][0] in "vV" and is_nonstr_iter(direction) ):