Sign up ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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.

share|improve this question
See this: (possible duplicate) As for the second part, it depends on how your data is stored. Please include a minimal example. – R. M. May 15 '14 at 1:23
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. – forumcash May 15 '14 at 2:06
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… 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 :) – hhh Sep 26 at 13:09

1 Answer 1

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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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