Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions proplot/internals/inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
14 changes: 14 additions & 0 deletions proplot/tests/test_axes.py
Original file line number Diff line number Diff line change
@@ -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])