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

Cannot specify both x and y in Deephaven express dx.violin #451

Closed
mofojed opened this issue May 1, 2024 · 2 comments · Fixed by #699
Closed

Cannot specify both x and y in Deephaven express dx.violin #451

mofojed opened this issue May 1, 2024 · 2 comments · Fixed by #699
Assignees
Labels
bug Something isn't working
Milestone

Comments

@mofojed
Copy link
Member

mofojed commented May 1, 2024

Description

If you try and specify both x and y in Deephaven express, it throws an error about how you can't set both x and y. But with violin plots you should be able to.

Steps to reproduce

  1. Run the following snippet:
import plotly.express as px

df = px.data.tips()
fig_violin = px.violin(df, y="tip", x="smoker", color="sex", box=True, points="all", hover_data=df.columns)

from deephaven.pandas import to_table

tips = to_table(df)

import deephaven.plot.express as dx

dx_violin = dx.violin(tips, x="smoker", y="tip", color="sex", box=True, points="all")

Expected results

  1. Plot fig_violin and plot dx_violin should both open, and look similar

Actual results

  1. Plot fig_violin opens, but plot dx_violin does not. An error is outputted to the logs:
r-Scheduler-Serial-1 | .c.ConsoleServiceGrpcImpl | Error running script: java.lang.RuntimeException: Error in Python interpreter:
Type: <class 'ValueError'>
Value: Cannot specify both x and y
Line: 130
Namespace: violin
File: /opt/deephaven/venv/lib/python3.10/site-packages/deephaven/plot/express/plots/distribution.py
Traceback (most recent call last):
  File "<string>", line 12, in <module>
  File "/opt/deephaven/venv/lib/python3.10/site-packages/deephaven/plot/express/plots/distribution.py", line 130, in violin

Versions

Engine Version: 0.35.0-SNAPSHOT
Web UI Version: 0.74.0
Java Version: 21.0.3
Barrage Version: 0.6.0
Browser Name: Chrome 123
OS Name: macOS 10.15.7

@mofojed mofojed added bug Something isn't working triage labels May 1, 2024
@mofojed
Copy link
Member Author

mofojed commented May 1, 2024

Actually I may be incorrect - if you use the by= property you can plot it correctly it appears:

dx_violin = dx.violin(tips, y="tip", by="smoker", color="sex", box=True, points="all")

@jnumainville
Copy link
Collaborator

You should be able to plot both. Not sure why I thought otherwise. Maybe because you only have to specify one dimension and the second is optional. Plot by can be used as a workaround for now but really those are slightly different results.

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

Successfully merging a pull request may close this issue.

3 participants