From 7a495a14d78d9e54da546e3f5182434e816209c0 Mon Sep 17 00:00:00 2001 From: SorooshMani-NOAA Date: Tue, 5 Mar 2024 10:21:47 -0500 Subject: [PATCH 1/2] Fix point plot color --- ensembleperturbation/plotting/geometry.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ensembleperturbation/plotting/geometry.py b/ensembleperturbation/plotting/geometry.py index d77084a5..2ee5b692 100644 --- a/ensembleperturbation/plotting/geometry.py +++ b/ensembleperturbation/plotting/geometry.py @@ -126,10 +126,14 @@ def plot_points( :param title: whether to add a title to the plot """ - if isinstance(points, Iterable): - if not isinstance(points, MultiPoint): - points = MultiPoint(points) - points = numpy.squeeze(numpy.stack((point._get_coords() for point in points), axis=0)) + if isinstance(points, MultiPoint): + points = numpy.squeeze( + numpy.stack( + [list(point.coords)[0][:3] for point in points.geoms], + axis=0)) + + if not isinstance(points, numpy.ndarray): + points = numpy.array(points) if axis is None: axis = pyplot.gca() From 35e07f89aa16981a3b7b79690c56e94733576d1b Mon Sep 17 00:00:00 2001 From: SorooshMani-NOAA Date: Tue, 5 Mar 2024 10:25:30 -0500 Subject: [PATCH 2/2] Fix style --- ensembleperturbation/plotting/geometry.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ensembleperturbation/plotting/geometry.py b/ensembleperturbation/plotting/geometry.py index 2ee5b692..c65ddd1e 100644 --- a/ensembleperturbation/plotting/geometry.py +++ b/ensembleperturbation/plotting/geometry.py @@ -128,9 +128,8 @@ def plot_points( if isinstance(points, MultiPoint): points = numpy.squeeze( - numpy.stack( - [list(point.coords)[0][:3] for point in points.geoms], - axis=0)) + numpy.stack([list(point.coords)[0][:3] for point in points.geoms], axis=0) + ) if not isinstance(points, numpy.ndarray): points = numpy.array(points)