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
{{ message }}
Repository navigation
Error in plotly express scatter with continuous_color_scale and marginal_x #2059
So to make it work, using the string name is not working, need to pass the corresponding actual list of colors like color_continuous_scale=px.colors.sequential.Viridis
a bit of a problem (though may be due to my inexperience on this).
for my dash playground app, where user can select a color scheme, i managed to find a 'detour' using the following ex:
sequential_swatch=['Brwnyl', 'Agsunset', etc..., 'Viridis', 'Plotly3'] sequential_swatch_dict={x:getattr(px.colors.sequential,x) for x in sequential_swatch}
and in the callback to update the plot, i use for ex:
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.
changed the title [-]Error plotly express scatter with continuous_color_scale and marginal_x[/-][+]Error in plotly express scatter with continuous_color_scale and marginal_x[/+]on Aug 12, 2024
Activity
chk2817 commentedon Jan 11, 2020
So to make it work, using the string name is not working, need to pass the corresponding actual list of colors like
color_continuous_scale=px.colors.sequential.Viridisa bit of a problem (though may be due to my inexperience on this).
for my dash playground app, where user can select a color scheme, i managed to find a 'detour' using the following ex:
sequential_swatch=['Brwnyl', 'Agsunset', etc..., 'Viridis', 'Plotly3']sequential_swatch_dict={x:getattr(px.colors.sequential,x) for x in sequential_swatch}and in the callback to update the plot, i use for ex:
fig=px.scatter(...., color_continuous_scale=swatches_dict['Viridis']...)where 'Viridis' can be any other color scheme selection from sequential, diverging etc...
nicolaskruchten commentedon Jan 11, 2020
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.
wbeardall commentedon Mar 3, 2023
This is still an issue as of 5.12.0.
Minimal reproducible example is provided below.
Edited traceback is given below:
[-]Error plotly express scatter with continuous_color_scale and marginal_x[/-][+]Error in plotly express scatter with continuous_color_scale and marginal_x[/+]Fix px marginal color with named continuous color scales