Open
Description
To better distinguish similar values, it would be nice if the color scale of px.imshow()
could be made logarithmic without changing the values by displayed text_auto=True
.
Closest I've found so far is to np.log
the df and change the color bar ticks:
df_log = np.log10(df)
fig = px.imshow(
df_log,
text_auto=True,
)
ticks = [1, 0.5, 0.2, 0.1, 0.05, 0.02, 0.01]
vals = np.log10(ticks)
fig.update_layout(coloraxis_colorbar=dict(tickvals=vals, ticktext=ticks))