diff --git a/proplot/internals/inputs.py b/proplot/internals/inputs.py index a55d6e266..d369270a0 100644 --- a/proplot/internals/inputs.py +++ b/proplot/internals/inputs.py @@ -130,15 +130,16 @@ def _to_numpy_array(data, strip_units=False): data = data.data # support pint quantities that get unit-stripped later elif isinstance(data, (DataFrame, Series, Index)): data = data.values - if data.dtype == bool: - data = data.view(np.uint8) if Quantity is not ndarray and isinstance(data, Quantity): if strip_units: return np.atleast_1d(data.magnitude) else: return np.atleast_1d(data.magnitude) * data.units else: - return np.atleast_1d(data) # natively preserves masked arrays + d = np.atleast_1d(data) # natively preserves masked arrays + if d.dtype == bool: + d = d.view(np.uint8) + return d def _to_masked_array(data, *, copy=False): diff --git a/proplot/tests/test_axes.py b/proplot/tests/test_axes.py new file mode 100644 index 000000000..84c128af7 --- /dev/null +++ b/proplot/tests/test_axes.py @@ -0,0 +1,14 @@ +import pytest + +import numpy as np +import proplot as pplt + + +def test_axes_plot(): + """Test axes plots work with lists or arrays""" + x = np.arange(10) + fig, ax = pplt.subplots() + ax.plot(x) + ax.plot(x, x) + + ax.plot([1, 2, 3], [4, 5, 6])