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

Skip to content

Commit 05e8501

Browse files
oscargusgreglucas
andauthored
Update lib/matplotlib/cbook/__init__.py
Co-authored-by: Greg Lucas <[email protected]>
1 parent f17f3af commit 05e8501

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/matplotlib/cbook/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2233,7 +2233,8 @@ def _unpack_to_numpy(x):
22332233
if hasattr(x, 'to_numpy'):
22342234
# Assume that any function to_numpy() do actually return a numpy array
22352235
return x.to_numpy()
2236-
if hasattr(x, 'values'):
2236+
if isinstance(getattr(x, 'values', None), np.ndarray):
2237+
return x.values
22372238
xtmp = x.values
22382239
# For example a dict has a 'values' attribute, but it is not a property
22392240
# so in this case we do not want to return a function

0 commit comments

Comments
 (0)