tanglegram icon indicating copy to clipboard operation
tanglegram copied to clipboard

Coloring the Connecting branches

Open chaunceychason opened this issue 7 years ago • 3 comments

Would it be possible to implement the color functionality contained in the original R code so that the middle panel isnt just grey? I have tons of items in my dendrogram, so currently the connecting bars are all running together as a single grey bar. Being able to change the color on those objects would be super helpful

chaunceychason avatar Jul 19 '18 00:07 chaunceychason

Could you clarify please? I see three options to colourise off the top of my head:

  1. Give connecting lines have the same colour as the leafs in the dendrogram. What if the left and the right leaf have different colours?
  2. Assign custom colours to each connecting line (i.e. per label)?
  3. Map entanglement to RGB value instead of shades of grey.

schlegelp avatar Jul 19 '18 07:07 schlegelp

Thanks for the reply. I noticed the function doesnt return a plot object to modify. I could easily manually assign the colors if the API allows it. Is there a fig or plt instance for each subplot?

On Thu, Jul 19, 2018 at 2:21 AM, Philipp Schlegel [email protected] wrote:

Could you clarify please? I see three options to colourise off the top of my head:

  1. Give connecting lines have the same colour as the leafs in the dendrogram. What if the left and the right leaf have different colours?
  2. Assign custom colours to each connecting line?
  3. Map entanglement to RGB value instead of shades of grey.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/schlegelp/tanglegram/issues/3#issuecomment-406179983, or mute the thread https://github.com/notifications/unsubscribe-auth/AM8pAhK8_PFC-aZb0hMonWIGco3YHhX1ks5uIDNmgaJpZM4VVlkF .

chaunceychason avatar Jul 20 '18 03:07 chaunceychason

Yes you're right. The function returns a matplotlib figure. It has three axes which you can get with fig.get_axes(). The first two are the left and right dendrogram respectively, the last one is the centre lines. Have a go at it and let me know if you figure out a way to colourise them that makes sense to you.

I'll try to implement a way to do this natively.

schlegelp avatar Jul 21 '18 07:07 schlegelp