0
$\begingroup$

At https://wolfram.com/language/12/improved-visualization-labeling/venn-diagram.html?product=mathematica

one finds the code

a = Disk[{0, 1}];b = Disk[{-0.5, 0}];c = Disk[{0.5, 0}];subsets = Subsets[{a, b, c}, {1, 3}];subsetscolors =  Map[Function[{c},  Blend[Flatten[Map[Table[Map[Append[#, 1.5/Length[c]] &, c], 2] &, c]]]], Subsets[Map[ColorData[112], Range[3]], {1, 4}]];RegionPlot[Evaluate[DiscretizeRegion[RegionDifference[BooleanRegion[And, #],BooleanRegion[Or, Complement[{a, b, c, EmptyRegion[2]}, #]]]] & /@ subsets], PlotLabels->Callout[(StringJoin @@@ Subsets[{"A", "B", "C"}, {1, 3}]), Center],Sequence[PlotStyle -> subsetscolors, BoundaryStyle -> Directive[Thickness[0.01], White], Frame -> False, LabelStyle -> {24}, PerformanceGoal -> "Speed", ImageSize -> 450]]

to "Use PlotLabels to label a three-set Venn diagram in RegionPlot".

My first question is whether this can be "upgraded" to a 3D-scenario in which Sphere is employed instead of Disk?

Probably, a "tall order", I would imagine--well beyond my capabilities/understanding, in any case.

Also, can such codes be applied to non-"Basic Geometric Regions"? (My ambition would be to use the 3D regions specified by the constraints A, B, C at the end of Create a Venn and/or related diagrams given the eight atoms of a three-set (A,B,C) 256-dimensional Boolean algebra

$\endgroup$
  • 1
    $\begingroup$ How would you want to visualize the intersections? In some sense the usual Venn diagram is a slice through two intersection spheres $\endgroup$ – b3m2a1 May 22 at 20:47
3
$\begingroup$

This is only a start, but is this within your capabilities/understanding?

a={1,0,-1/Sqrt[2]};b={-1,0,-1/Sqrt[2]};c={0,1,1/Sqrt[2]};d={0,-1,1/Sqrt[2]};
Graphics3D[{Opacity[1/2],
  Sphere[a,3/2],Sphere[b,3/2],Sphere[c,3/2],Sphere[d,3/2],
  Text["A",a],Text["B",b],Text["C",c],Text["D",d],
  Text["AB",(a+b)/2],Text["AC",(a+c)/2],
  Text["AD",(a+d)/2],Text["BC",(b+c)/2],
  Text["BD",(b+d)/2],Text["CD",(c+d)/2],
  Text["ABC",(a+b+c)/3],Text["ABD",(a+b+d)/3],
  Text["ACD",(a+c+d)/3],Text["BCD",(b+c+d)/3],
  Text["ABCD",(a+b+c+d)/4]
}]

Can you see how that was done? Can you see how each part might work? Can you adjust the Opacity and size and Text size to make that better? Can anyone else suggest why dragging the box with the mouse doesn't seem to correctly show the Text sometimes?

There are a LOT of labels to be able to distinguish in one diagram, but perhaps you can learn a bit from this and make some progress and be better prepared to do other things in the future.

| improve this answer | |
$\endgroup$
  • $\begingroup$ Well, of course, all fine and good, Bill, and answers the question in some sense. What I immediately had in mind--and clearly exceeded my "capabilities/understanding"--was whether one could "lift" all these specific commands involving Region in the original 2D Venn-diagram code to a 3D setting . Surely, one can't just replace "Region" by "Region3D' in all these commands (RegionDifference, BooleanRegion, DiscretizeRegion, EmptyRegion)--as I just simply-mindedly checked. $\endgroup$ – Paul B. Slater May 23 at 12:31
  • $\begingroup$ I've seen a number of times that the graphical demonstrations presented of some of the Wolfram features look very impressive and very well done, but when I have tried to adapt or extend them or make use of them in another larger context that I struggle and struggle and finally just give up. I wonder if the demonstrations might have the goal of just presenting what they displayed, rather than providing the basis for something that can be modified and extended and enhanced by the typical user. It looks like there is no Region3D but that Region works in 2d or 3d. But I don't "decorate graphs" $\endgroup$ – Bill May 23 at 15:07
0
$\begingroup$

Regarding the concluding paragraph of my question:

"Also, can such codes be applied to non-"Basic Geometric Regions"? (My ambition would be to use the 3D regions specified by the constraints A, B, C at the end of Create a Venn and/or related diagrams given the eight atoms of a three-set (A,B,C) 256-dimensional Boolean algebra "

I have just posted an answer to it--but employing different coding than that discussed in the question here--at the indicated site.

| improve this answer | |
$\endgroup$
  • $\begingroup$ I recalled some articles published a few years ago where they did Venn diagrams of more than three variables. A quick Google search for Venn diagram four variables or even Venn diagram five variables showed images for diagrams that are not like what I remembered, but they seem much closer to to the structure of the diagram that you are looking to generalize. They are just using four or five circles. That might mean you try using the methods described on the Wolfram page without needing to find a way to map the code into the third dimension. Perhaps those will let you get where you want to go. $\endgroup$ – Bill May 23 at 20:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.