0
当我尝试使用包matplotlib_venn绘制维恩图时遇到一些困难。matplotlib_venn:无法绘制某些值的维恩图
详细说明:
- 如果我使用数据[13,12,73,3,3,1,12],可以按预期
- 如果我使用数据产生的曲线图[13487,12029,7314,336,371,17,12611],则不能生成图形。
我该怎么办?
在此先感谢!
代码:
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()
这可能是一个错误,如果您将336更改为大于365的数字,它可以工作。当你的get_label_by_id为336时返回None。 – Dark