4
$\begingroup$

My problem has two parts. Before that I have two Lists/Sets. It suppose to be created them by two initial strings.

In the first part, I need to show sets' elements in venn diagram. I can create venn diagram with following code but it is not enough for my purpose. Also, I don't want to use internet.

WolframAlpha["(A \[Intersection] B)", {{"VennDiagram", 1}, "Content"}]

I don't need coloring though. On the other hand, A and B are two different sets. I need to show their elements in appropriate places. Here is an example image:

enter image description here

Second part, I should show this two sets ordered in column representation. If there are matching elements, arrows should point from appropriate element of A to appropriate element of B. Here is an example image:

enter image description here

It is pretty challenging. Thanks everybody for their attention.

$\endgroup$
  • $\begingroup$ See this: mathematica.stackexchange.com/q/2554/5 (possible duplicate) As for the second part, it depends on how your data is stored. Please include a minimal example. $\endgroup$ – rm -rf May 15 '14 at 1:23
  • $\begingroup$ I am going to give two strings such as "This is an example entry.". I saw the link before, but they don't have any element. $\endgroup$ – forumcash May 15 '14 at 2:06
  • $\begingroup$ I tried to get more attention to this question by labelling it more appropriately as "wolfram-alpha-queries" and asking the question only in the case of Mathematica in Quora quora.com/… where I outlined my investigation so far. I could not find anything about Set Diagram or Venn Diagram in Mathematica manual or anything in List Manipulation related to visualisation. I hope we get answer to this :) $\endgroup$ – hhh Sep 26 '15 at 13:09
4
$\begingroup$

Perhaps this unsophisticated attempt is a starting point.

whales = {"have hair", "live birth", "breathe air", "live in water", 
   "have fins", "can swim"};
fish = {"lay eggs", "have scales", "breathe water", "live in water", 
   "have fins", "can swim"};
tint = Intersection[whales, fish];
w = Complement[whales, tint];
f = Complement[fish, tint];
r1 = Disk[{-1, 0}, 2];
r2 = Disk[{1, 0}, 2];
int = RegionIntersection[r1, r2]
rd1 = RegionDifference[r1, int]
rd2 = RegionDifference[r2, int]
fun[u_, v_] := 
 Text[Column[u, BaseStyle -> {Purple, 16}], RegionCentroid[v]]
RegionPlot[{rd1, int, rd2}, 
 PlotStyle -> {Yellow, Blend[{Yellow, LightRed}, 1/2], LightRed}, 
 Frame -> None, AspectRatio -> Automatic, 
 Epilog -> MapThread[fun, {{tint, w, f}, {int, rd1, rd2}}]~Join~  
    {Text[Style["WHALE", 20], {-1, 1.7}], 
  Text[Style["FISH", 20], {1, 1.7}]}, 
     ImageSize -> 600]

enter image description here

$\endgroup$

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