Closed rdius closed 4 years ago
Can you provide the full traceback for the attribute error ( not just the final message)?
Hi, here the full traceback:
/home/user/anaconda3/lib/python3.7/site-packages/matplotlib_venn/_venn3.py:117: UserWarning: Bad circle positioning
warnings.warn("Bad circle positioning")
Traceback (most recent call last):
File "/home/user/Téléchargements/matplotlib_venn_wordcloud-master/matplotlib_venn_wordcloud/venn_wc3.py", line 64, in
Process finished with exit code 1
Thank you!
Thank you for raising the issue, that was actually really helpful.
The problem arises because 2 of the subsets are empty or near-empty.
(set(cv) & set(tf)) - set(umls)
# {'antiviral activity', 'hiv aids'}
# i.e. given sets cv, uml, tv, the subset 101 is nearly empty
set(umls) <= (set(cv) | set(tf))
# True
# i.e. given sets cv, uml, tv, the subset 010 is empty:
As a consequence, matplotlib-venn (not my code) fails to find a valid layout (warnings.warn("Bad circle positioning")
). Specifically, in the layout returned, the patch corresponding to subset 101 does not exist even though the word list is non-empty. My code then chokes on the fact that it expects a patch for each non-empty subset.
I can't fully resolve your issue as the layout is not something I can control. You would have to raise the issue with the creator/maintainer of matplotlib-venn. However, I do have created a workaround of sorts, such that the missing patch no now longer raises an error but just a warning, and the figure is created (albeit without a wordcloud for the subset without a patch).
Uploaded the new version to PyPI.
Hi @paulbrodersen ,
Thank you so must for your help and quick reply. That's working good for me.
Thanks!
Always happy to help when I get a such a good bug report. Take care!