我想使用Python 3制作维恩图以显示分类数据。 如果可以,请说
Pipeline(memory=None,
steps=[('scaler', StandardScaler(copy=True, with_mean=True, with_std=True)), ('clf', SGDClassifier(alpha=0.0001, average=False, class_weight=None, epsilon=0.1,
eta0=0.0, fit_intercept=True, l1_ratio=0.15,
learning_rate='optimal', loss='hinge', max_iter=None, n_iter=None,
n_jobs=1, penalty='l2', power_t=0.5, random_state=None,
shuffle=True, tol=None, verbose=0, warm_start=False))])
然后我得到一个the number of entries corresponding to each segment的图表,但我想要的是the actual entries in each segment(即薯片,仅Rosy钻头的蛋糕甜食,交叉路口的巧克力和Steven钻头的薯片和矿块) 。可以使用matplotlib_venn进行此操作吗?
答案 0 :(得分:1)
我发现的最好方式是这样的:
set1 = set(['A', 'B', 'C', 'D'])
set2 = set(['B', 'C', 'D', 'E'])
v = venn2([set1, set2], ('Set1', 'Set2'))
v.get_label_by_id('10').set_text('\n A')
v.get_label_by_id('01').set_text('\n E')
v.get_label_by_id('11').set_text('\n \nB \nC \nD')
plt.show()