Problem with hover display in heatmap with plotlyjs backend

if i use the plotly backend to make a heatmap with a small number of categorical variables then everything is fine

using Plots

categories = string.(collect('a':'e'))
n = length(categories) #5
heatmap(categories, categories, rand(n,n))

which is to say that the hover always shows the x and y categories and the value

But when the number of categories becomes large then the x and y axes are, very reasonably, labeled with only a subset of the categories. That’s fine, but the problem is that the hover display doesn’t show the underlying category unless it happens to be displayed along the axis:

categories = string.(collect('a':'z'))
n = length(categories) #26
heatmap(categories, categories, rand(n,n))



Finally, my question: Is there a way to force the heatmap function to display the underlying categories even when the categorical values of the x and/or y coords are not displayed along the axis?

You can try this:

using Plots; plotly()
categories = 'a':'z'
n = length(categories) #26
t = (0.5:(n-0.5), categories)
heatmap(categories, categories, rand(n,n), ticks=t)
1 Like

That’s great, thank you.