Skip to content
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

ValueError when passing numpy array as edgecolors argument to scatter #5211

Closed
jaminsore opened this issue Oct 8, 2015 · 2 comments
Closed

Comments

@jaminsore
Copy link

import numpy as np
import matplotlib.pyplot as plt
edgecolors = np.r_[['b'] * 5, ['r'] * 5]  
x, y = np.random.randn(10), np.random.randn(10)

plt.scatter(x, y, edgecolors=edgecolors, c='none')

raises

ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

But changing the call to plt.scatter() to

plt.scatter(x, y, edgecolors=edgecolors.tolist(), c='none')

Works as expected. This error is occurring inside a try, except block so it looks it should be an easy fix.

@WeatherGod
Copy link
Member

WeatherGod commented Oct 8, 2015 via email

@jaminsore
Copy link
Author

Ok, I will close this, then. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants