I am working on using Venn diagram to explain logic and logical connections between sets. After coming upon these answers: Create a Venn Diagram, How to plot Venn diagrams with Mathematica?, which I found very helpful I was wondering if there is a way to convert the statement All Bananas are Tasty. (All Bananas are elements of Tasty or Bananas $\iff$ Tasty) and All Apples are Tasty (Apples $\iff$ Tasty) into a Venn diagram with three circles labeled?
The difference between this question and the questions above is I am wondering how to label an area of the Venn diagram, as well as how to instead of using $A_1$ and $A_2$ as values as explained in this good well-explained answer https://mathematica.stackexchange.com/a/2557/76873 by user https://mathematica.stackexchange.com/users/495/fjra use the values Bananas, Apples, and Tasty.
I am also wondering if there is a way to color the Venn diagram, possibly using PlotStyle or a graphics primitive?
So far I have tried:
Module[{i, r = .6, R = 1, v, grouprules, x, y, x1, x2, y1, y2, ve},
v = Table[Circle[r {Cos[#], Sin[#]} &[2 Pi (i - 1)/n], R], {i, n}];
{x1, x2} = {Min[#], Max[#]} &[
Flatten@Replace[v,
Circle[{xx_, yy_}, rr_] :> {xx - rr, xx + rr}, {1}]];
{y1, y2} = {Min[#], Max[#]} &[
Flatten@Replace[v,
Circle[{xx_, yy_}, rr_] :> {yy - rr, yy + rr}, {1}]];
ve[x_, y_, i_] :=
v[[i]] /. Circle[{xx_, yy_}, rr_] :> (x - xx)^2 + (y - yy)^2 < rr^2;
grouprules[x_, y_] =
ineqs /. Table[
With[{is = i}, Subscript[_, is] :> ve[x, y, is]], {i, n}];
Show[If[MatchQ[ineqs, {} | False], {},
RegionPlot[grouprules[x, y], {x, x1, x2}, {y, y1, y2},
Axes -> False]], Graphics[v],
PlotLabel ->
TraditionalForm[Replace[ineqs, {} | False -> \[EmptySet]]],
Frame -> False]]
p1 = Bananas \[Equivalent] Tasty
p2 = Apples \[Equivalent] Tasty
VennDiagram2[3,
And[Bananas \[Equivalent] Tasty , Apples \[Equivalent] Tasty]]
EDIT (thanks to User criedhne): I was able to get this code:
Bananas = Disk[{0, 1}];
Apples = Disk[{-0.5, 0}];
Tasty = Disk[{0.5, 0}];
subsets = Subsets[{Bananas, Apples, Tasty}, {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[{Bananas, Apples, Tasty, EmptyRegion[2]}, #]]]] & /@
subsets],
PlotLabels ->
Callout[(StringJoin @@@
Subsets[{"Bananas", "Apples", "Tasty"}, {1, 3}]), Center],
Sequence[PlotStyle -> subsetscolors,
BoundaryStyle -> Directive[Thickness[0.01], White], Frame -> False,
LabelStyle -> {24}, PerformanceGoal -> "Speed", ImageSize -> 450]]
My question is how to change the example Venn diagram's complex code to reflect the two logical statements mentioned above.