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

Customized colorbar scale #24

Open
dasiav7 opened this issue Apr 24, 2018 · 3 comments
Open

Customized colorbar scale #24

dasiav7 opened this issue Apr 24, 2018 · 3 comments
Labels

Comments

@dasiav7
Copy link

dasiav7 commented Apr 24, 2018

Is it possible to set the colorscale that most value are white which means that not just the midpoint is white?

@AliciaSchep
Copy link
Contributor

Not sure I understand -- can you please provide a more concrete example?

@dasiav7
Copy link
Author

dasiav7 commented Apr 26, 2018

Hi,
Please see the image below. Thank you!

customised colorbar

@AliciaSchep
Copy link
Contributor

Thanks for clarification. Unfortunately this is not easy with package as of now. A hacky work-around is to pass a vector of colors with several instances of "white", e.g:

mat <- matrix(rnorm(36),nrow = 6)
iheatmap(mat, colors = c("darkred","red","white","white","white","green","darkgreen")) 

Adjusting the number of colors specified, the fraction that are white, could give you the effect you're looking for.

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

3 participants