Skip to content

Commit

Permalink
Updated named_arrays.plt.scatter() to handle matplotlib >= 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
byrdie committed Jan 15, 2024
1 parent 3a07bec commit 46770a6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion named_arrays/_scalars/scalar_named_array_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,10 @@ def plt_scatter(
s = na.broadcast_to(s, shape_orthogonal)

if np.issubdtype(na.get_dtype(c), np.number):
c = na.broadcast_to(c, shape)
if "rgba" in c.shape:
c = na.broadcast_to(c, shape | dict(rgba=c.shape["rgba"]))
else:
c = na.broadcast_to(c, shape)

Check warning on line 391 in named_arrays/_scalars/scalar_named_array_functions.py

View check run for this annotation

Codecov / codecov/patch

named_arrays/_scalars/scalar_named_array_functions.py#L391

Added line #L391 was not covered by tests
else:
if "rgba" in c.shape:
c = na.broadcast_to(c, shape_orthogonal | dict(rgba=c.shape["rgba"]))

Check warning on line 394 in named_arrays/_scalars/scalar_named_array_functions.py

View check run for this annotation

Codecov / codecov/patch

named_arrays/_scalars/scalar_named_array_functions.py#L394

Added line #L394 was not covered by tests
Expand Down

0 comments on commit 46770a6

Please sign in to comment.