You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default, histograms are not overlayed, which leads to misinterpretation :
importnumpyasnpimportpandasaspdimportplotly.expressaspxx0=np.random.randn(250)
# Add 1 to shift the mean of the Gaussian distributionx1=np.random.randn(250) +1df=pd.DataFrame(dict(
series=np.concatenate((["a"] *len(x0), ["b"] *len(x1))),
data=np.concatenate((x0, x1))
))
px.histogram(df, x="data", color="series")
Makes think that there is much more points in red distribution :
While overlying clearly shows that it is just shifted
I wouldn't call this a bug; often you explicitly want these histograms to stack so you can see the shape of the combined distribution. But perhaps this is the more common desire when you've split the distribution by color? Also I find the argument about consistency with marginals to be compelling.
@gvwilson I don't think this should be a change at the level of plotly.js, just px, so it can stay here. I'd also consider it a breaking change so if we were to do it we should do it in a major.
Reopening of #1865, as asked in the comment.
By default, histograms are not overlayed, which leads to misinterpretation :
Makes think that there is much more points in red distribution :
While overlying clearly shows that it is just shifted
This leads to misunderstanding the data shape.
The text was updated successfully, but these errors were encountered: