I'm sure there is probably a way to do it using some combination of pyplot commands, but given this comes up quite a bit for venn diagrams, it would be nice if there was a clean way to specify labels and counts for the null-combination of classes. For example, the venn2 function should be able to cleanly handle input like...
and it should document the fact that their are 2 data points that aren't in list 1 or list 2 somewhere on the resultant figure. For now my easiest sollution to this is to just use pyplot.text and manually create the label for the category, but this is clunky. Another arguably less clunky sollution is to create the null category as a new label type and do something like...
I don't like this sollution though as it adds a false dimension to the data creating lots of positions where it seems like a count should exist but doesn't. ("111" for example)
The ideal sollution would both add the label for the 00* category to the legend and provide the ability to label the whitespace with the relevant count and name. This would probably require adding a keyword argument to the vennK functions to make them into something like.
EDIT: Played with it some more. Here is a way to add "null" labels to venn diagrams at the moment for anyone reading this. Would be nice if something like this became default behavior though or could easily be done through the use of an optional argument like "null_name" above
# names = some list of label names
# labels = dict mapping label combinations to counts as usual
fig, ax = venn2(labels, names)
# remake legend with null label
ax.plot([], color="white")
legend_null_label = "neither : 2"
ax.legend( [legend_null_label] + names, loc='center left', bbox_to_anchor=(1.0, 0.5), fancybox=True)
# optionally add the information somewhere on the figure
ax.text(0.95, 0.4, legend_null_label)
I'm sure there is probably a way to do it using some combination of pyplot commands, but given this comes up quite a bit for venn diagrams, it would be nice if there was a clean way to specify labels and counts for the null-combination of classes. For example, the venn2 function should be able to cleanly handle input like...
and it should document the fact that their are 2 data points that aren't in list 1 or list 2 somewhere on the resultant figure. For now my easiest sollution to this is to just use pyplot.text and manually create the label for the category, but this is clunky. Another arguably less clunky sollution is to create the null category as a new label type and do something like...
I don't like this sollution though as it adds a false dimension to the data creating lots of positions where it seems like a count should exist but doesn't. ("111" for example)
The ideal sollution would both add the label for the 00* category to the legend and provide the ability to label the whitespace with the relevant count and name. This would probably require adding a keyword argument to the vennK functions to make them into something like.
EDIT: Played with it some more. Here is a way to add "null" labels to venn diagrams at the moment for anyone reading this. Would be nice if something like this became default behavior though or could easily be done through the use of an optional argument like "null_name" above