Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected color sorting in case of continuous row_side_colors values #286

Open
jgoldmann opened this issue Mar 9, 2023 · 3 comments
Open
Labels

Comments

@jgoldmann
Copy link

Hi,

Thanks for implementing and such a great package!

I found something unexpected when attempting to visualize a continuous variable as row_side_colors:

library(heatmaply)
mat <- matrix(rnorm(1000),   #generate data
                        ncol=10)
heatmaply(mat, 
      row_side_colors = c(-50:49), #some easy continuous values to be annotated
      Rowv = FALSE)

image

The mouseover text reveals that the labels are neatly ordered from -50 on the top to 49 on the very bottom. However, the colors seem not in order, there is a hue break between -10 and -9 and then again between -1 and 0 and finally between 9 and 10.

Wouldn't there be a way to tell heatmaply that this is a continous variable?

@jgoldmann jgoldmann added the bug label Mar 9, 2023
@alanocallaghan
Copy link
Collaborator

Due to how plotly handles heatmaps we don't really support continuous variables in the side colours at present. Unfortunately I'd have to suggest binning them

@jgoldmann
Copy link
Author

Ah, I see, then I shall try binning for now.
Would it be an idea to mention this in the manual?

@alanocallaghan
Copy link
Collaborator

Yes should probably update the docs, although I'll see if I can block a bit of time the next weeks to fix this behaviour in general

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants