我正在使用 matplotlib_venn 中的 python venn3 函数试验一个奇怪的问题
111 补丁的值为 None 即使其中有 2 个元素。
由于未定义补丁,这是我得到的结果:
如您所见,数字是正确的,但圆圈不正确。
组成集合的元素是str,每个字符串是两个单词,中间有一个空格。111由'expert revision', 'stakeholder mapping'
如果有人知道什么会导致这个问题......
这是一个重现此的小示例:
from matplotlib_venn import venn3
from matplotlib import pyplot as plt
A = {'tourism product', 'stakeholder mapping', 'vegetable group', 'cash credit', 'forestry research', 'vegetable supply', 'project workshop', 'development center', 'nature plants', 'marketing practices', 'ecology transition', 'water rice', 'expert revision', 'lakh tons', 'group fund', 'ayeyarwady region', 'frog production', 'customer engagement', 'work package', 'br ief', 'cashew nuts', 'ring test', 'rice area', 'certification pilot', 'agriculture market'}
B = {'monsoon rice', 'id imgres', 'month banana', 'crop selection', 'vegetable production', 'crop stage', 'soil losses', 'project review', 'pest problems', 'production limits', 'extension model', 'expert revision', 'sea agricultures', 'cdca dca', 'extension staff', 'staphylococcus aureus', 'disease problems', 'relay crops', 'update study', 'support village', 'project update', 'study villages', 'material cost', 'pasture land', 'research collaboration'}
C = {'stakeholder mapping', 'rice farmers', 'tree species', 'risk perception', 'calao project', 'plant development', 'climate resilience', 'field guide', 'agroecology practices', 'impact evaluations', 'paddy rice', 'forest areas', 'expert revision', 'engineering rice', 'school garden', 'farmer field', 'task leader', 'family farming', 'pesticide risk', 'adaptation strategies', 'note series', 'forestry administration',
'farming land', 'water infrastructures', 'potato plants'}
sets = [A, B, C]
plt.figure(figsize=(6,6))
v = venn3(sets)
print(v.get_patch_by_id('111'))
print("intersection :", A.intersection(B).intersection(C))
plt.show()