Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #1823

Re: Venn diagrams?

From Mark McClure <mcmcclur@unca.edu>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Venn diagrams?
Date 2011-04-21 07:10 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <iool9t$bok$1@smc.vnet.net> (permalink)

Show all headers | View raw


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

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: Venn diagrams? Mark McClure <mcmcclur@unca.edu> - 2011-04-21 07:10 +0000

csiph-web