Skip to content
Closed

Rgba fix #18058

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
2 changes: 1 addition & 1 deletion lib/matplotlib/colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ def to_rgba_array(c, alpha=None):
# `to_rgba(c, alpha)` (below) is expensive for such inputs, due to the need
# to format the array in the ValueError message(!).
if cbook._str_lower_equal(c, "none"):
return np.zeros((0, 4), float)
return np.zeros((1, 4), float)
try:
return np.array([to_rgba(c, alpha)], float)
except (ValueError, TypeError):
Expand Down
8 changes: 8 additions & 0 deletions lib/mpl_toolkits/tests/test_mplot3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,14 @@ def test_scatter3d():
z[-1] = 0 # Check that scatter() copies the data.


def test_scatter3d_nonfilledmarker():
# Check that scattering a non-filled marker works
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.scatter(np.arange(10), np.arange(10), np.arange(10), marker='x')
fig.canvas.draw()


@mpl3d_image_comparison(['scatter3d_color.png'])
def test_scatter3d_color():
fig = plt.figure()
Expand Down