-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Error in plotly express scatter with continuous_color_scale and marginal_x #2059
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
Comments
So to make it work, using the string name is not working, need to pass the corresponding actual list of colors like
and in the callback to update the plot, i use for ex:
where 'Viridis' can be any other color scheme selection from sequential, diverging etc... |
Thanks for reporting this problem! Definitely a bug that was introduced when we started accepting string names and lists of lists as color scales instead of just lists of colors. We'll try to get a fix into the next version. |
This is still an issue as of 5.12.0. Minimal reproducible example is provided below.
Edited traceback is given below:
|
Hello
i am logging this as i think this might be a bug. I found while building a Dash app but the same issue arises in a a jupyter notebook.
import plotly.express as px
df = px.data.iris()
below, it works as expected:
fig = px.scatter(df, x="sepal_width", y="sepal_length", color="sepal_length",color_continuous_scale='Viridis')
fig
so is the following
fig = px.scatter(df, x="sepal_width", y="sepal_length", color="sepal_length",marginal_x='box')
fig
But the following expression breaks down
fig = px.scatter(df, x="sepal_width", y="sepal_length", color="sepal_length",marginal_x='box',color_continuous_scale='Viridis')
fig
it looks like box marker is using 'V' of Viridis in the color_continuous_scale.
Thanks
The text was updated successfully, but these errors were encountered: