Closed wuzhe1234 closed 3 years ago
Hi @wuzhe1234
We use the same scale for the colormap as for the data. So should be able to do something like that:
import hiplot as hip
# Create experiment as usual
column = "metric"
maximum_abs = max(abs(dp.values.get(column, 0)) for dp in experiment.datapoints)
experiment.parameters_definition[column] = ValueDef(type=hip.ValueType.NUMERIC).force_range(minimum=maximum_abs, maximum=-maximum_abs)
# Display experiment as usual
Hi @wuzhe1234
We use the same scale for the colormap as for the data. So should be able to do something like that:
import hiplot as hip # Create experiment as usual column = "metric" maximum_abs = max(abs(dp.values.get(column, 0)) for dp in experiment.datapoints) experiment.parameters_definition[column] = ValueDef(type=hip.ValueType.NUMERIC).force_range(minimum=maximum_abs, maximum=-maximum_abs) # Display experiment as usual
Thank you, problem solved! I use "hip.ValueDef(value_type=hip.ValueType.NUMERIC)" instead of "hip.ValueDef(type=hip.ValueType.NUMERIC)" to make it work.
Best Regards.
Is there any way have a centered on zero colormap?