Skip to content

Rgba fix #18058

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
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