konstantint / matplotlib-venn

Area-weighted venn-diagrams for Python/matplotlib
MIT License
496 stars 67 forks source link

added "force" parameter for venn2 and venn3 to force drawing of the venn... #4

Closed olgabot closed 10 years ago

olgabot commented 10 years ago

... diagrams even if some of the areas are zero

Also cleaned up the code via PyCharm's refactoring.

olgabot commented 10 years ago

wait this is buggy. I'll let you know when it's fixed

konstantint commented 10 years ago

Hey, thanks!

I think that the idea of adding a "force" parameter is not very good, though. Firstly, the name "force" is somewhat vaguely unclear and is too much of a feature creep. Secondly, either the function knows how to work with zero values and should do it without any additional forcing, or the function does not handle it and it should refuse to output garbage even if forced. If the user wants to force garbage on himself, he can just catch and ignore the exception.

I think I originally added the check for zero areas even before I coded the method to avoid having to deal with corner cases. Brief testing shows that the method actually handles zero areas fairly gracefully (not without warnings, though).

So what I'll do is rather than add a "force" parameter, I'll make sure that things work with zero areas with no additional forcing. (There will still be an exception for negative areas).

olgabot commented 10 years ago

Hi Konstantin, That sounds good! I was running into issues where one of my venns had an area of zero, but the others were nonzero, but I still wanted to show all three categories which is why I considered adding a force parameter. I agree it's rather unclear, and I think your solution is better. Olga

konstantint commented 10 years ago

Solved in last version.