This repository has been archived by the owner on Jun 3, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Subplots using differnet columns? #127
Comments
Plotly Express operates on "tidy data" only, so you will need to reshape your data frame before passing it into import pandas as pd
df = pd.read_csv(pd.compat.StringIO("""
PlantID,A,B,C,D
1,0,1,2,4
1,3,0,2,0
3,0,0,0,1
4,0,1,1,5
"""))
print(df.head())
print(df.melt(id_vars=["PlantID"]).head())
Meaning that you can do: import plotly.express as px
px.box(df.melt(id_vars=["PlantID"]), x="variable", y="value") |
Thank you! Although this is not what I want, it solve my problems. (●^o^●) |
We've actually implemented support for subplots per columns! https://medium.com/plotly/beyond-tidy-plotly-express-now-accepts-wide-form-and-mixed-form-data-bdc3e054f891 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
For example:
plot1: px.box(df, y='feature1')
plot2: px.box(df, y='feature2')
The facet_row and facet_col can make subplots on one columns, but I want to make subplots on differents columns.
The text was updated successfully, but these errors were encountered: