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

Violin plots crash when given all zeros #2897

Closed
slinnarsson opened this issue Jul 30, 2018 · 2 comments
Closed

Violin plots crash when given all zeros #2897

slinnarsson opened this issue Jul 30, 2018 · 2 comments
Labels
type: bug Something isn't correct or isn't working
Milestone

Comments

@slinnarsson
Copy link

I'm truly enjoying learning HoloViews - such a great visualization library!

I encountered a bug, I think. Changing the Violin plot example to give it all zeros causes an exception:

>>> groups = [chr(65+g) for g in np.random.randint(0, 3, 200)]
>>> hv.Violin((groups, np.random.randint(0, 5, 200), np.zeros(200)), ['Group', 'Category'], 'Value')
(...stack trace here...)
TypeError: 'NoneType' object is not iterable

Most likely the kernel density estimation fails. This is an issue for visualizing many groups, when one or more groups may be all zeros. The expected result is a flat line, I suppose (this is what BoxWhisker does).

@ea42gh
Copy link
Contributor

ea42gh commented Jul 30, 2018

hv.Violin([]) fails as well

@philippjfr philippjfr added the type: bug Something isn't correct or isn't working label Jul 31, 2018
@philippjfr philippjfr added this to the v1.11 milestone Jul 31, 2018
@jlstevens
Copy link
Contributor

Thanks @slinnarsson and @ea42gh! I agree both those issues are bugs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't correct or isn't working
Projects
None yet
Development

No branches or pull requests

4 participants