Hello,
Iβm trying to make plotly imshow accept two different hover text values that are different to the axis values, using the code below:
matrix = graph_to_matrix(edf, G.nodes)
x_axis = list(G.nodes)
y_axis = x_axis[::-1]
#these are what I want to add :D
custom_data = np.dstack([np.array([genome_protein_data[n]['product'] for n in x_axis]),
np.array([genome_protein_data[n]['product'] for n in y_axis])])
######
figure_test = px.imshow (gmat[::-1],
x = x_axis,
y = y_axis,
labels=dict(x="Target",
y="Source",
color="Number"))
fig.update_layout(coloraxis_colorbar_x=0.8)
#this doesn't work - from https://stackoverflow.com/a/63185950/11357695
fig.update_traces(
hovertemplate="<br>".join([
"X: %{x}",
"X product: %{customdata[0].3f}",
"Y: %{y}",
"Y product: %{customdata[1].3f}",
])
)
figure_test.write_html('my_file.html')
I get almost what I want, but my custom data isnβt substituting:
How do I get the proper x/y product values?
Cheers!
Tim