mmngreco / pyvenn

2 ~ 4 sets venn diagram for python
The Unlicense
0 stars 0 forks source link

ENH: Perceptual color mixing #1

Open juanmpga opened 3 months ago

juanmpga commented 3 months ago

Currently in the overlapping regions of the venn diagram it looks like the color of the last circle is dominating, which makes it seem like that last circle is somehow more important or more related to the mixed area. It would be nice if the color mixing could be done in a symmetric / order independent way.

An example of current behavior: https://raw.githubusercontent.com/wiki/tctianchi/pyvenn/venn3.png An example of desired behavior: https://en.m.wikipedia.org/wiki/File:3-set_Venn_diagram.svg

mmngreco commented 2 months ago

Oh, very nice! However, I don't know how to make it possible with the current implementation, as it uses transparency to provide the perception of overlap. Maybe Matplotlib has a way to do it... There's high uncertainty on my side.

juanmpga commented 2 months ago

Perhaps redrawing the intersections on top of the original figures to set their color independently could work. I found this library which could be helpful in that regard: https://shapely.readthedocs.io/en/latest/manual.html#object.symmetric_difference. Anyway, the change wouldn't be straightforward and there's certainly a reasonable amount of uncertainty so for me it's not worth the effort for the moment.