jolars / eulerr

Area-Proportional Euler and Venn Diagrams with Ellipses
https://jolars.github.io/eulerr/
GNU General Public License v3.0
130 stars 18 forks source link

Different euler diagrams on different runs #62

Closed ArcticG closed 4 years ago

ArcticG commented 4 years ago

Dear John Larsson, Thank you for your help with eulerr package. The package is really useful and has been doing great with venn diagrams and 3 way euler diagrams. I have noticed an issue with more complex euler diagrams in my hands, leading to reproducibility issue.

For example: After running the same code 6 times I obtained somewhat different euler diagrams with the same data. The resulting plots are shown as E1-E6 in below link with E3/E1 being the closest to the graph I was hoping for, but graphs like E2 being the most recurring ones:

https://ibb.co/DgcrK3H

Notes:

  1. I also have included venn diagram of the same data on the top to show the expected relationship between groups.
  2. (quantities = F) has not changed the variable output.

I wonder if there is a way/option to make the results more consistent/reproducible for more complex euler diagrams.

I would be happy to answer any questions about system/setting used or send the raw data via email if it would be helpful. Thank you

jolars commented 4 years ago

I'm glad your finding it useful @ArcticG. Have you tried using set.seed(some number) ? It should make everything reproducible. Unfortunately, it's not otherwise possible to control the output since the results are based on optimization methods.

ArcticG commented 4 years ago

Thank you for your reply. You are correct and setting seed solves the reproducibility issue. I simply tried a sequence of ten seeds and picked the one that produces the correct diagram.

As a side suggestion, it might be helpful if the package could notify/warn the user if all the overlapping areas are not included in the generated diagram. Although I do not know if it would be feasible/possible behind_the_scenes or worth the effort.

Thank you again for the package and your reply and happy new year!