Subset Diagrams

Other than seeing a number of Graphviz diagrams, I don’t know anything about Graphviz. All the ones I’ve seen are implication or flow diagrams. Can it produce subset diagrams? In case that’s not clear, I mean instead of showing A flows to, leads to, or impies B, can Graphviz display A inside B using kind of Venn diagram.

Short answer: probably not.
Better answer: maybe, depending on exactly what you are wanting to see and how many different graphs you might produce.
Would you share an example or two of what you want to see? Hand drawn would be fine.

1 Like

Here are some more related answers, pro & con:

Thanks, Steve for your interest in my question.

The example attached at the java venn diagram link you sent is closest to what I had in mind.

Closer still would be to imagine either of the two halves of the image with an optional V in the intersection of X and Z and an optional XZ label for the union of X and Z and an optional XYZ label for the union of those three categories. I say “optional” because there are times when the unions and intersections have names and other times when that’s not important. With more complicated labeling colors or arrows would probably be needed to associate labels with their sets.

The set relationships are independent of the way they are displayed. Most of the flow diagrams I see in the Graphviz gallery could be illustrated with set diagrams like the one attached, and vice versa.

Graphviz won’t do the placement for a diagram like WXYZ above, but it can do the drawing.
So, you’d need to provide the program (or eyeballs) to set the placement (positioning). I did this by eyeball in about 30 minutes (graph paper would have helped):

graph V {
  node [shape=circle fontsize=12]
  // height & width in inches
  // pos in points. marks the center
  W [height=1   pos="144,144"]
  Y [height=1    pos="216,144" label="" xlabel="Y"  xlp="192,160"] 
  X [height=.55 pos="221,159" label="" xlabel="X"  xlp="232,160"] 
  G [height=.55 pos="209,136" label="" xlabel="G"  xlp="202,136"]
  mylabel1 [shape=plaintext pos="0,0" label=""   xlabel="XG" xlp="217,148"]


Note: this requires a neato -n command line (FAQ | Graphviz)
All-in-all I’d probably use a different drawing program.

Yeah, we did not work on this problem. It’s a neat problem. I’ve seen several research papers on this topic. I’m not convinced anything can scale beyond 8 or 10 sets. There is some empirical evidence for this. This doesn’t mean it shouldn’t be attempted, but it’s good to understand the limitations.

For exploring overlapping sets, I like the “UpSet” work from Hanspeter Pfister’s lab - it’s on GitHub and it’s been productized too. However it does not employ a Venn-Euler notation, instead, they use a kind of vector notation to show set membership. It looks helpful for many data analysis applications.

You’re right that the idea is limited in the form I first suggested. Depending on the arrangement the limitation might be less than 8 or 10. But that limitation is not as limiting as it may seem at first. You can graphically pull a section of a set. For example:

Yet, we must consider the general case.

Here’s a typical example of a more complex diagram. This was created by a certain Sara Fisher, published on “pinterest”. Without following the details closely, I’m not sure it’s an area-proportional venn diagram, though with more distortion, that could be possible.


I just noticed

The PDF diagram of adjectives is an impressive illustration of set intersections. I saw this on pinterest web site. It’s a good example of intersections, unions, subsets and supersets.