title: Customize hover text for plotly heatmap
body: <p>I have a <code>matrix</code> (gene expression from several conditions):</p>
  
  <pre><code>set.seed(1)
  mat &lt;- matrix(rnorm(50*10),nrow=50,ncol=10,dimnames=list(paste("C",1:50,sep="."),paste("G",1:10,sep=".")))
  </code></pre>
  
  <p>Which I want to plot as a <code>heatmap</code> using <code>plotly</code> in <code>R</code>.</p>
  
  <pre><code>require(plotly)
  heatmap.plotly &lt;- plot_ly(x=colnames(mat),y=rownames(mat),z=mat,type="heatmap",colors=colorRamp(c("darkblue","white","darkred")),colorbar=list(title="Score",len=0.4)) %&gt;%
    layout(yaxis=list(title="Condition"),xaxis=list(title="Gene"))
  </code></pre>
  
  <p>works fine.</p>
  
  <p>However, I'd like to add text that would be seen only when hovered over.</p>
  
  <p>I thought this would work:</p>
  
  <pre><code>conditions.text &lt;- paste(paste("C",1:50,sep="."),rep(paste(LETTERS[sample(26,10,replace=T)],collapse=""),50),sep=":")
  heatmap.plotly &lt;- plot_ly(x=colnames(mat),y=rownames(mat),z=mat,type="heatmap",colors=colorRamp(c("darkblue","white","darkred")),colorbar=list(title="Score",len=0.4),hoverinfo='text',text=~conditions.text) %&gt;%
    layout(yaxis=list(title="Condition"),xaxis=list(title="Gene"))
  </code></pre>
  
  <p>But it doesn't. I actually don't see any text when hovering over the plot.</p>
  
  <p>Note that I'm working with a <code>matrix</code> rather than a <code>melted</code> <code>data.frame</code>.</p>