VennDiagram - Maple Help

Statistics

 VennDiagram
 generate Venn diagrams

 Calling Sequence VennDiagram(S1, S2, S3, S4, S5, options)

Parameters

 S1 - data or Boolean-valued procedure S2,S3,S4,S5 - (optional) data or Boolean-valued procedure options - (optional) equation(s) of the form option=value where option is one of colors, datasetlabels, legend, proportional, universe or p; specify options for generating the Venn diagram

Options

 The options argument can contain one or more of the options listed below.
 VennDiagram also accepts all plot options supported by the plots[display] command. See plot[options] for details.
 • colors=list
 This option specifies a list of colors for the individual sets. Each of the regions will be colored with the corresponding color in the list.
 • datasetlabels=absolute, contents, relative, or none.
 This option controls data set labels on the Venn diagram regions. The default, datasetlabels=absolute, labels each subset with its absolute cardinality. The relative option will display, for each region, the percentage value that region occupies. The contents option will display the actual set elements in each region; for large sets this may result in overlapping text. The none option specifies that no labels should be drawn.
 • legend=true,false, or list
 This option controls whether a legend describing the sets should be displayed in a legend below the Venn diagram. If legend=false, no legend is shown. If legend=true, a legend showing the complete contents of each of the sets is displayed. If legend is a a list of strings or names, these names will be displayed in the legend.
 • proportional=true or false
 This option specifies that the relative areas of the regions in the generated diagram should be proportional to the relative sizes of the sets they represent. The default is false. Note that proportional diagrams are supported only for one or two sets.
 • universe=list,Array,DataFrame, inferred, or none
 This option specifies the universal set of which the subsets S1,...,S5 are subsets. When universe is a specified as a container object, the size of this set minus all other provided sets is included in the generated diagram outside the regions representing each of the sets. When universe=inferred, the universe set is inferred to be the union of all specified sets and a zero is included the diagram (representing the size of the universe minus all specified sets). Otherwise if universe=none, no such size is shown. The default is none.

Description

 • The VennDiagram command generates a Venn diagram for the specified data. A Venn diagram is a method of visualizing the relationships between multiple sets by depicting these sets as regions inside closed curves.
 • This command accepts up to five parameters representing distinct sets of data. When three or fewer parameters are provided, the sets are depicted as circles. If four or five parameters are provided, the sets are depicted as ellipses.
 • Each of the parameters S1,...,S5 is a list, set, Vector, DataSeries, DataFrame, or Boolean-valued procedures. The Venn diagram depicts the relationships between S1,...,S5 considered as sets.
 • If any of S1,...,S5 is a Boolean-valued procedure, the universal set must be specified explicitly with the universe option. The associated subset is then computed implicitly by applying the specified Boolean-valued procedure against the universal set.

Examples

 > $\mathrm{with}\left(\mathrm{Statistics}\right):$
 > $\mathrm{VennDiagram}\left(\left\{1,2,3\right\},\left\{1,2,4\right\}\right)$

Illustrate a simple three-part Venn diagram describing properties of various animals.

 > $\mathrm{FurryAnimals}≔\left\{"Bat","Cat","Dog","Gerbil","Caterpillar"\right\}:$
 > $\mathrm{Pets}≔\left\{"Cat","Dog","Gerbil","Lizard","Parrot","Snake","Goldfish"\right\}:$
 > $\mathrm{FlyingAnimals}≔\left\{"Bat","Eagle","Parrot","Vulture","Wasp","Butterfly"\right\}:$
 > $\mathrm{VennDiagram}\left(\mathrm{FurryAnimals},\mathrm{Pets},\mathrm{FlyingAnimals},\mathrm{legend}=\left["Furry Animals","Pets","Flying Animals"\right]\right)$

Illustrate a simple three-part diagram using Boolean predicates while specifying the universe set as the positive integers from 1 to 100.

 > $\mathrm{VennDiagram}\left(\mathrm{isprime},\mathrm{issqr},x↦\mathrm{irem}\left(x,3\right)=0,\mathrm{universe}=\left\{\mathrm{}\left(1..100\right)\right\},\mathrm{legend}=\left["Prime","Square","Multiple of 3"\right]\right)$

Illustrate a four-set Venn diagram using the Iris dataset. In this example, we display four subsets of the Iris dataset, each of which is the result of filtering the dataset by a different column in the DataFrame.

 > $\mathrm{iris}≔\mathrm{Import}\left("datasets/iris.csv",\mathrm{base}=\mathrm{datadir}\right)$
 ${\mathrm{DataFrame}}{}\left({{\mathrm{_rtable}}}_{{36893627856997008436}}{,}{\mathrm{rows}}{=}\left[{1}{,}{2}{,}{3}{,}{4}{,}{5}{,}{6}{,}{7}{,}{8}{,}{9}{,}{10}{,}{11}{,}{12}{,}{13}{,}{14}{,}{15}{,}{16}{,}{17}{,}{18}{,}{19}{,}{20}{,}{21}{,}{22}{,}{23}{,}{24}{,}{25}{,}{26}{,}{27}{,}{28}{,}{29}{,}{30}{,}{31}{,}{32}{,}{33}{,}{34}{,}{35}{,}{36}{,}{37}{,}{38}{,}{39}{,}{40}{,}{41}{,}{42}{,}{43}{,}{44}{,}{45}{,}{46}{,}{47}{,}{48}{,}{49}{,}{50}{,}{51}{,}{52}{,}{53}{,}{54}{,}{55}{,}{56}{,}{57}{,}{58}{,}{59}{,}{60}{,}{61}{,}{62}{,}{63}{,}{64}{,}{65}{,}{66}{,}{67}{,}{68}{,}{69}{,}{70}{,}{71}{,}{72}{,}{73}{,}{74}{,}{75}{,}{76}{,}{77}{,}{78}{,}{79}{,}{80}{,}{81}{,}{82}{,}{83}{,}{84}{,}{85}{,}{86}{,}{87}{,}{88}{,}{89}{,}{90}{,}{91}{,}{92}{,}{93}{,}{94}{,}{95}{,}{96}{,}{97}{,}{98}{,}{99}{,}{100}{,}{101}{,}{102}{,}{103}{,}{104}{,}{105}{,}{106}{,}{107}{,}{108}{,}{109}{,}{110}{,}{111}{,}{112}{,}{113}{,}{114}{,}{115}{,}{116}{,}{117}{,}{118}{,}{119}{,}{120}{,}{121}{,}{122}{,}{123}{,}{124}{,}{125}{,}{126}{,}{127}{,}{128}{,}{129}{,}{130}{,}{131}{,}{132}{,}{133}{,}{134}{,}{135}{,}{136}{,}{137}{,}{138}{,}{139}{,}{140}{,}{141}{,}{142}{,}{143}{,}{144}{,}{145}{,}{146}{,}{147}{,}{148}{,}{149}{,}{150}\right]{,}{\mathrm{columns}}{=}\left[{\mathrm{Sepal Length}}{,}{\mathrm{Sepal Width}}{,}{\mathrm{Petal Length}}{,}{\mathrm{Petal Width}}{,}{\mathrm{Species}}\right]\right)$ (1)
 > $\mathrm{VennDiagram}\left(\mathrm{~}\left[\mathrm{<}\right]\left(\mathrm{iris}\left[\mathrm{Sepal Length}\right],\mathrm{ },5.8\right),\mathrm{~}\left[\mathrm{<}\right]\left(\mathrm{iris}\left[\mathrm{Sepal Width}\right],\mathrm{ },3\right),\mathrm{~}\left[\mathrm{<}\right]\left(\mathrm{iris}\left[\mathrm{Petal Length}\right],\mathrm{ },3.75\right),\mathrm{~}\left[\mathrm{<}\right]\left(\mathrm{iris}\left[\mathrm{Petal Width}\right],\mathrm{ },1.3\right),\mathrm{universe}=\mathrm{iris},\mathrm{legend}=\left["Sepal Length < 5.8","Sepal Width < 3","Petal Length < 3.75","Petal Width < 1.3"\right]\right)$
 > 

Compatibility

 • The Statistics[VennDiagram] command was introduced in Maple 2017.