Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

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


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

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

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Mark McClure

Posts: 193
Registered: 9/12/07
Re: Venn diagrams?
Posted: Apr 21, 2011 2:34 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.