Skip to content

Commit 0b590bb

Browse files
authored
Merge pull request #410 from scottstanie/fix-imshow-bool
fix: convert bool to `np.uint8` in `_to_numpy_array`
2 parents ab8de2d + 947f252 commit 0b590bb

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

proplot/internals/inputs.py

+2
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ def _to_numpy_array(data, strip_units=False):
130130
data = data.data # support pint quantities that get unit-stripped later
131131
elif isinstance(data, (DataFrame, Series, Index)):
132132
data = data.values
133+
if data.dtype == bool:
134+
data = data.view(np.uint8)
133135
if Quantity is not ndarray and isinstance(data, Quantity):
134136
if strip_units:
135137
return np.atleast_1d(data.magnitude)

0 commit comments

Comments
 (0)