Statistics - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Graphics : Statistics : Statistics/VennDiagram

Statistics

  

VennDiagram

  

generate Venn diagrams

 

Calling Sequence

Parameters

Options

Description

Examples

Compatibility

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 sets. For diagrams of three or fewer sets, the sets are depicted as circles. For diagrams of four or five sets, 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

withStatistics:

VennDiagram1,2,3,1,2,4

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

FurryAnimalsBat,Cat,Caterpillar,Dog,Gerbil:

PetsCat,Dog,Gerbil,Goldfish,Lizard,Parrot,Snake:

FlyingAnimalsBat,Butterfly,Eagle,Parrot,Vulture,Wasp:

VennDiagramFurryAnimals,Pets,FlyingAnimals,legend=Furry Animals,Pets,Flying Animals

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

VennDiagramisprime,issqr,x→iremx,3=0,universe=`$`1..100,legend=Prime,Square,Multiple of 3

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.

irisImportdatasets/iris.csv,base=datadir

irisSepal LengthSepal WidthPetal LengthPetal WidthSpecies15.13.51.40.2setosa24.931.40.2setosa34.73.21.30.2setosa44.63.11.50.2setosa553.61.40.2setosa65.43.91.70.4setosa74.63.41.40.3setosa853.41.50.2setosa94.42.91.40.2setosa104.93.11.50.1setosa`:``:``:``:``:`150 x 5 DataFrame

(1)

VennDiagram`~`:-`<`iris`Sepal Length`&comma;` $`&comma;5.8&comma;`~`:-`<`iris`Sepal Width`&comma;` $`&comma;3&comma;`~`:-`<`iris`Petal Length`&comma;` $`&comma;3.75&comma;`~`:-`<`iris`Petal Width`&comma;` $`&comma;1.3&comma;universe&equals;iris&comma;legend&equals;Sepal Length < 5.8&comma;Sepal Width < 3&comma;Petal Length < 3.75&comma;Petal Width < 1.3

Compatibility

• 

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

• 

For more information on Maple 2017 changes, see Updates in Maple 2017.

See Also

Statistics

Statistics[PieChart]

Statistics[TreeMap]

Statistics[Visualization]