Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ed036db

Browse files
committed
Simplify shape check
1 parent 0673de9 commit ed036db

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

lib/matplotlib/collections.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2055,15 +2055,10 @@ def __init__(self, *args, **kwargs):
20552055
# end of signature deprecation code
20562056

20572057
super().__init__(**kwargs)
2058+
_api.check_shape((None, None, 2), coordinates=coords)
20582059
self._coordinates = coords
2059-
shape = self._coordinates.shape
2060-
if (self._coordinates.ndim != 3 or shape[-1] != 2):
2061-
raise ValueError(
2062-
"coordinates must be a (N, M, 2) array-like, but got "
2063-
f"{shape}")
2064-
2065-
self._meshWidth = shape[1] - 1
2066-
self._meshHeight = shape[0] - 1
2060+
self._meshWidth = self._coordinates.shape[1] - 1
2061+
self._meshHeight = self._coordinates.shape[0] - 1
20672062
self._antialiased = antialiased
20682063
self._shading = shading
20692064

0 commit comments

Comments
 (0)