Heatmap bug stretches cells that should not exist

Hi everyone,

I’ve encountered what I think is a bug of plotly/R when drawing a heatmap. There is something similar here, but it refers to plotly.js.

Here is an example of my data:
image

Values between FcCur > 8 and FcCur < 20 do not exist. However, their location is filled by some stretched data points with x = 20. You can see the problem here:

If drawing the same heatmap with ggplot2, the result is correct (edit: data are different, but the result is the same even with data from the above plot that are simply rescaled):

The problem arises both by using ggplotly(ggplot-plot) and the following code:
fig ← plot_ly() %>%
add_trace(data = df_grp_scaled, x=~bsu_FcCur, y =~bsu_Vstack, z =~n, hoverinfo = ‘text’, text =~ text, type = “heatmap”)

Do you have any idea on what could cause the problem?

Thank you in advance,
Giacomo

Hi, the problem seems to be still existing; My heatmap does exactly the same, it extends certain cells till the next not direct neighbor multiple cells wide. Any possible solution or advice by anyone in the meantime? Thanks!

In the meantime I have found a workaround: add ‘None’ -s in the empty cells in the 1st row and 1st column. This way the stretched cells disappeared for me.