-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Feature Request: Support list inputs for plotly express x, y arguments #2224
Comments
This comment has been minimized.
This comment has been minimized.
Thanks @nicolaskruchten for the helpful example - just what I needed! |
We've actually gone ahead an implemented this feature after all! https://medium.com/plotly/beyond-tidy-plotly-express-now-accepts-wide-form-and-mixed-form-data-bdc3e054f891 |
Support for wide format is very nice to have. However, what I am struggling with is the issue that a px.line plot connects traces resulting from different columns as demonstrated in this MWE:
My hope/expectation was that above code results in the union of below two separate plots, i.e. without connecting the data across different columns
|
You can resolve this by adding df = pd.DataFrame(data={'who':['a','a','b','b'],
'x':[0,1,0,1],
'score':[1.0,2,3,4],
'miss':[3.2,2.5,1.3,1.5],
})
px.line(df,x='x',y=['miss','score'], color='who', line_group="variable", width=300,height=300).show() |
The default value of |
Perhaps this should be the default :) |
@eisenlohr as of 4.8.2, |
First off, thanks for the awesome plotly.express package, its fulfilling a great need for interactive plotting capabilities.
One problem I've encountered frequently is that I have variables I want to plot in separate columns in my dataframe, and I have to make a subplot to plot the distributions or correlations of all of these variables. For these purposes, it would be very helpful if
px.scatter
,px.box
, and the other px methods could accept the lists of column names as x or y variables. Note that this is different from faceting by column or row, because for the facet: (a) the yaxes and/or xaxes are typically shared, and (b) the "column" or row to be faceted on is a single column. Would love to hear the communities thoughts about this idea. Example code below.The text was updated successfully, but these errors were encountered: