Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Visualize the intersections and aggregates of intersections of tuples of intersecting sets
ResourceFunction["UpSetChart"][{tuple1,tuple2,…}] charts the list of related tuples {tuple1,tuple2,…}. | |
ResourceFunction["UpSetChart"][{{tuple1,1,tuple1,2,…},{tuple2,1,tuple2,2,…},…}] charts the list of sublists of related tuples. |
Set Menu Chart | Lower Left | BarChart of the cardinality of each element in the lists of tuples |
Cardinality Chart | Upper Right | BarChart of the cardinality of each subset of the lists of tuples |
Combination Matrix Plot | Lower Right | Plot of the subsets in the list of tuples |
AspectRatio | {1/GoldenRatio,1/GoldenRatio} | aspect ratios used for the set menu and cardinarity sub-charts |
Background | Lighter[LightGray] | style used for placeholders in combination matrix subplot |
ChartLegends | None | list of labels used for the legend for the set menu sub-chart |
ChartStyle | Automatic | list of styles used for the set menu and cardinality sub-charts |
ImagePadding | {{20,2},{15,2}} | image padding of the combination matrix subplot |
ImageSize | {Medium,Small} | size of the combination matrix subplot |
PlotMarkers | Graphics[Disk[{0,0},Scaled[0.025]]] | markers used for the combination matrix subplot |
PlotStyle | Gray | style used for the combination matrix subplot |
PlotTheme | Automatic | theme applied to all subplots and sub-charts |
"SortingFunctions" | {Identity,Identity} | sort functions applied to the elements of the set menu and cardinality sub-charts |
Simulate data for a survey of 30 animal lovers for the types of pets they have:
In[1]:= |
Out[3]= |
View relationships:
In[4]:= |
Out[4]= |
Simulate data for a survey of 15 homes in two cities for the types of vehicles they own:
In[5]:= |
Out[6]= |
View relationships of both categories:
In[7]:= |
Out[7]= |
Set menu and cardinality sub-charts are sized to the combination plot. However, their size can be adjusted with AspectRatio. Use default sizes for a fixed-sized combination plot:
In[8]:= |
Out[8]= |
Supply AspectRatio specification for set menu and cardinality sub-charts to adjust their size:
In[9]:= |
Out[9]= |
Supply a style for the placeholders of the combination matrix subplot:
In[10]:= |
Out[10]= |
Create example data:
In[11]:= |
Supply a list of labels and a list of styles:
In[12]:= |
Out[12]= |
Create example data:
In[13]:= |
Supply a list of styles:
In[14]:= |
Out[14]= |
Set menu and cardinality sub-charts image padding uses the combination plot's image padding. Default image padding may be too narrow to fit set menu or cardinality sub-chart axis labels:
In[15]:= |
Out[15]= |
Supply ImagePadding specification to display full chart labels:
In[16]:= |
Out[16]= |
Default sizing compresses large combination matrix subplots:
In[17]:= |
View with default ImageSize:
In[18]:= |
Out[18]= |
Increase ImageSize for a larger combination matrix subplot:
In[19]:= |
Out[19]= |
Create example data:
In[20]:= |
Set the shape of combination matrix plot markers:
In[21]:= |
Out[21]= |
Set PlotStyle of combination matrix plot markers:
In[22]:= |
View with PlotStyle specification:
In[23]:= |
Out[23]= |
Create example data:
In[26]:= |
Unsorted elements and subsets are listed as they appear in the data:
In[27]:= |
Out[27]= |
Sort the set menu sub-chart by its labels and the cardinality sub-chart by the total across all sets in reverse order:
In[28]:= |
Out[28]= |
Both the ChartStyle and ChartLegends options must be supplied to return a legend:
In[29]:= |
Without both options:
In[30]:= |
Out[30]= |
With both options:
In[31]:= |
Out[31]= |
Explore the intersecting sets of class, sex and survived in the Titanic dataset:
In[32]:= |
Out[32]= |
This work is licensed under a Creative Commons Attribution 4.0 International License