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 fail with list inputs when data scale is logicle. #351

Open
JS3xton opened this issue Jan 26, 2021 · 0 comments
Open

Violin plots fail with list inputs when data scale is logicle. #351

JS3xton opened this issue Jan 26, 2021 · 0 comments

Comments

@JS3xton
Copy link
Contributor

JS3xton commented Jan 26, 2021

Violin plots fail with list inputs when data scale is logicle in FlowCal v1.3.0.

E.g.,

>>> FlowCal.plot.violin(data=[1,3,2,4,3])

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\sexto\Downloads\taborlab_FlowCal\FlowCal\plot.py", line 1810, in violin
    t = _LogicleTransform(data=data, channel=channel)
  File "C:\Users\sexto\Downloads\taborlab_FlowCal\FlowCal\plot.py", line 271, in __init__
    if d.ndim > 1:
AttributeError: 'list' object has no attribute 'ndim'

This happens because plot._LogicleTransform checks for multidimensional data using the ndim attribute, which numpy arrays have but lists do not. (The plot violin functions use _LogicleTransform to calculate default bin edges and implicitly when they set the Logicle scale. In both cases, data are provided as is.)

A simple work-around is to pass a numpy array to the plot functions.

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

No branches or pull requests

1 participant