当我尝试使用matplotlib_venn包绘制维恩图时,我遇到了一些困难。
详细信息:
我该怎么办?
提前致谢!
代码:
import matplotlib.pyplot as plt
from matplotlib_venn import venn3, venn3_circles
weights = [13, 12, 73, 3, 3, 1, 12] # these weights work
# weights = [13487, 12029, 7314, 336, 371, 17, 12611] # these weights do not work
labels = ['100', '010', '110', '001', '101', '011', '111']
fig, axis = plt.subplots(1, 1)
v = venn3(subsets=weights, ax=axis)
for label, weight in zip(labels, weights):
v.get_label_by_id(label).set_text(str(weight))
fig.show()
答案 0 :(得分:0)
也许这个维恩图不存在,因为对应于标签' 111'大于对应于标签' 110'的重量。 将12611更改为较小的一个将起作用。