Home > other >  Converting an array of RGB colours to a px.imshow heatmap
Converting an array of RGB colours to a px.imshow heatmap

Time:12-15

I currently have a DF of different RGB colour values in this format:

          Protein_ID1  Protein_ID2  Protein_ID3
Module1    [R, G, B]    [R, G, B]    [R, G, B]    
Module2    [R, G, B]    [R, G, B]    [R, G, B]    
Module3    [R, G, B]    [R, G, B]    [R, G, B] 

I would like to display this with px.imshow as a eat map, with the cell colour corresponding to the RGB value.

When I do:

fig = px.imshow(df)
fig.update_layout(
                  xaxis=dict(
                             rangeslider=dict(visible=True)
                            )
                 )
fig.write_html(results_file)

I get nothing in the blank results file. Based on the first example enter image description here

  • Related