How to set up background color for R Plotly Heat Map?

You might want to take a look at Adding "invalid" values to a heatmap

and its associated R code: https://plot.ly/~etpinard/7415/heatmap-with-custom-nan-layer.r

Let me know if you need more help.