biocore / empress

A fast and scalable phylogenetic tree viewer for microbiome data analysis
BSD 3-Clause "New" or "Revised" License
48 stars 31 forks source link

Adding midpoint coloring #554

Open mortonjt opened 2 years ago

mortonjt commented 2 years ago

It would be great if there was support for diverging colormaps (vmin, vcenter and vmax) as done in matplotlib's TwoSlopeNorm. I think this use-case will become increasing common for publishing Empress figures in high impact venues that require fine-tuning of color legends.

To see what I mean, consider the following - I have two different differential abundance profiles that I want to compare, but because of the inability to put them on a common scale, the colors don't align (they are centered at -0.36 and -1.78 respectively when they should both be centered at zero). In my particular case, this is actually a blocking issue.

image

Also note that this has been raised in emperor before.

https://github.com/biocore/emperor/issues/708

mortonjt commented 2 years ago

zoops, just realized that this is partially implemented here : https://github.com/biocore/empress/pull/484 https://github.com/biocore/empress/pull/521

And has been mentioned in https://github.com/biocore/empress/issues/365 https://github.com/biocore/empress/issues/518 and https://github.com/biocore/empress/issues/529 will follow up with midpoint coloring in a sec