This is the main visualization interface to HierarchicalSet object. By
changing the type argument you control which types of plots are produced. See
datails for a walkthrough of the different plot types. All plots are based on
ggplot2 but heavily modified using gtable. Because of this the return value
is always a gtable object, so it is not possible to add additional geoms, or
change scales etc. on the result of plot()
.
# S3 method for HierarchicalSet
plot(
x,
label = TRUE,
type = "dendrogram",
transform = NULL,
style = theme_bw(),
quantiles = 0,
upperBound = 1,
tension = 0.8,
alpha = 1,
circular = TRUE,
showHierarchy = !circular,
evenHierarchy = circular,
outliers = NULL,
ratio = NULL,
n = 50,
...
)
A gtable object invisibly. This function is mainly called for the side effect of creating a plot.
A HierarchicalSet object to plot.
logical. Should sets be labeled.
The type of plot to produce. See detail. The name of the type may be abbreviated.
A string giving the scale transformation or a
scales::trans()
object.
A ggplot2 theme to use as basis for the plot. Defaults to theme_bw().
The quantiles to split outlying elements up in for outlying_elements plot. If length is above one a facetted plot will be produced.
The upper quantile threshold to include. Defaults to 1 (i.e. everything is included)
The tension used for the hierarchical edge bundles in outlying_elements plot. Defaults to 0.8
The alpha level for the edge bundles. Defaults to 1
Logical. Should the hierarchical edge bundles be laid out in a circular layout.
Logical. For intersectionStack plots, should a dendrogram mapping union sizes be drawn above the icicle plot. For outlying_elements plots should a dendrogram be plotted below (for circular) or to the left (for linear) of the edge bundles.
Logical. Should the heights of the dendrogram used for constructing the edge bundles be evened out.
A precomputed data.frame with outlier information, as
returned by outlying_elements()
.
Should outliers be plotted as a ratio instead of the raw number.
If NULL
the raw number is used, If "min"
the raw number is
divided by the number of elements in the smallest set of the pair, if
"max"
the largest set, and if "mean"
the mean pair size.
The number of coordinates to calculate for each edge in the outlyingElements plot.
Currently ignored
Currently 4 different plottypes are available:
Plots a horizontal dendrogram with the x-value mapped to the intersection size divided by the union size. This plot very clearly shows the rise in heterogenity as more and more sets are joined, and clearly shows clusters of very similar sets.
Plots a bottom-up icicleplot with height showing the size of the intersection. In essence this plot communicates the same type of information as a Venn-diagram, but in a scalable way and only showing the intersections along the hierarchy. Box color maps to the degree (number of sets) of the intersection making high-degree high-intersection as well as low-degree low-intersection boxes stand out.
Plots a traditional heatmap showing all 2-degree intersections. The sets are organized according to the hierarchy so the result should show a number of squares along the diagonal. If two very similar sets have been forced apart by the clustering, this will show up nicely as high value squares away from the diagonal.
Combines dendrogram, intersectStack and heatmap into a composite plot.
Plots intersects between two sets that are missing from the intersect of their shared top node as hierarchical edge bundles. It helps detect deviations from the global structure as defined by the hierarchcial clustering.