Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Venn diagrams?
Replies: 8   Last Post: Apr 21, 2011 2:34 AM

 Messages: [ Previous | Next ]
 Mark McClure Posts: 193 Registered: 9/12/07
Re: Venn diagrams?
Posted: Apr 21, 2011 2:34 AM

On Sun, Apr 17, 2011 at 7:54 AM, dantimatter <google@dantimatter.com> wrote:

> Is there a nice and easy way to make pretty Venn diagrams with
> Mathematica, where the areas of the circles and intersecting regions
> are to scale?

A student asked me how to *easily* generate Venn diagrams for a
presentation. I'm actually fairly adept at generating various images
with Mathematica but was a bit busy and turned to Wolfram|Alpha. The
results were pretty nice. In V8, you might just try the following:

wa = WolframAlpha[
"A intersect B union C intersect D",
{{"VennDiagram", 1}, "Content"}]

This generates a nice picture. Although I can't figure out a way to
get the code for the picture, you can manipulate it fairly easily.
Using this, I performed the following silliness:

g = Graphics @@ First[Cases[wa,
_GraphicsBox, Infinity]];
g = DeleteCases[g, _InsetBox, Infinity];
pos = Position[g, _RGBColor, Infinity];
g = MapAt[ColorData["StarryNightColors"][0] &,
g, pos[[{7}]]];
g = MapAt[ColorData["StarryNightColors"][1] &,
g, pos[[{1, 4}]]];
g = MapAt[ColorData["StarryNightColors"][0.5] &,
g, pos[[{2, 3, 5, 6}]]];
Show[g, ImageSize -> 500]

Of course, there's nothing like full programmatic control and I'm not
sure that this can meet your proportionality requirements. But it's
pretty easy!

Mark McClure

Date Subject Author
4/17/11 dantimatter
4/17/11 Murray Eisenberg
4/19/11 DrMajorBob
4/19/11 Murray Eisenberg
4/20/11 dantimatter
4/21/11 DrMajorBob
4/21/11 Bob Hanlon
4/21/11 Heike Gramberg
4/21/11 Mark McClure