I am trying to show the z
items as text on a Plotly heatmap. I am using the latest version (5.5.0) and following the exact example shown on the Plotly Heatmaps webpage (https://plotly.com/python/heatmaps/), see the section "Text on Heatmap Points" near the bottom.
My code is their example code, which is:
figHeatmap = go.Figure(
data=go.Heatmap(
z=[[1,20,30], [20,1,60], [30,60,1]],
text=[['1','2','3'],['4','5','6'],['7','8','9']],
texttemplate="%{text}",
textfont={"size":20}
)
)
When I render my app in a webpage, what I see is this:
But on their site it shows with the labels:
I don't get any errors when I run my app, and the labels do indeed show when I hover over the heatmap, but the text is not displaying on the heatmap as it should. Since I'm using their exact example, I don't understand what could be going wrong. Any thoughts?
[EDIT]: It seems like this might be an issue with Dash. When I run the example interactively, I do indeed get the text labels. But my application is part of a Dash app, and that is where I am not seeing the rendered labels.