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
I need a clarification on how to use colorscale.
I have some data that I would like to color according to their value, not based on % of max as in the example.
In Medium's article you write "But of course, you may want to create your own color scale, there are several ways to create one, my favorite is actually to use a percentage of max values".
Are they described somewhere?
I would like to assign colors according the absolute value, not the % of max value:
i.e. red if below 5; yellow if below 10; white between 10 and 20; black if bigger than 20.
Absolute colors, no shading.
Is this possible?
The text was updated successfully, but these errors were encountered:
then the values (your y parameter for the calplot) would need to be normalized to fit the colorscale.
def normalize(value):
if value < 5:
return 0.125
elif value < 10:
return 0.375
elif 10 <= value <= 20:
return 0.625
else:
return 0.875
df["value"] = df["value"].apply(normalize)
I don't think it's currently possible to keep the original values and use distinct colors without interpolation at the same time. You would need to able to modify the z parameter of the underlying go.Heatmap for that.
Hi. Great library!
I need a clarification on how to use colorscale.
I have some data that I would like to color according to their value, not based on % of max as in the example.
In Medium's article you write "But of course, you may want to create your own color scale, there are several ways to create one, my favorite is actually to use a percentage of max values".
Are they described somewhere?
I would like to assign colors according the absolute value, not the % of max value:
i.e. red if below 5; yellow if below 10; white between 10 and 20; black if bigger than 20.
Absolute colors, no shading.
Is this possible?
The text was updated successfully, but these errors were encountered: