Using discrete custom color in a plotly heatmap

后端 未结 4 564
暖寄归人
暖寄归人 2020-12-18 06:28

I\'m trying to generate a plotly heatmap, where I\'d like the colors to be specified by a discrete scale.

Here\'s what I mean:

Gene

4条回答
  •  爱一瞬间的悲伤
    2020-12-18 06:37

    I was thinking initially the same thing, which is to down-sample the gradient, but instead forcing harsher transitions seems to do the trick at least to make the colors more pronounced.

    interval.cols2 <- rep(interval.cols, each=1000)
    plot_ly(z=mat,x=colnames(mat),y=rownames(mat),type="heatmap",colors=interval.cols2)
    

提交回复
热议问题