I have a bar chart where I want some information to appear in the hover text. However, the “color = …” information appears automatically on the hover and I do no know how to disable this label. I guess it is because it is assigned an analytical expression and not a “direct” assignation as can be “x” or “y” (which I am able to disable or not easily).
Is there any solution in order to disable it from the hover information? Thanks in advance!
Here’s sample code and the hovering info is shown in the figure:
fig = px.bar(
df,
y="sector",
x="plot_dist",
color=np.log(df["z0"]),
hover_data={"plot_dist": ":.2f", "z0": ":.4f"},
labels={
"sector": "Sector [degrees]",
"plot_dist": "Distance [m]",
"z0": "z0 [m]",
},
title="<b>Roughness rose bar plot</b>",
orientation="h",
color_continuous_scale=[
(0, f'rgb{hex_to_rgb("#2A479E")}'),
(0.3, f'rgb{hex_to_rgb("#0DCF69")}'),
(0.6, f'rgb{hex_to_rgb("#F9FA96")}'),
(0.75, f'rgb{hex_to_rgb("#A8906A")}'),
(1.0, f'rgb{hex_to_rgb("#006600")}'),
],
range_color=[np.log(0.0002), np.log(3.0)],
)