omicverse.pl.venn#
- omicverse.pl.venn(sets={}, out='./', palette='bgrc', ax=False, ext='png', dpi=300, fontsize=None, bbox_to_anchor=(0.5, 0.99), nc=2, cs=4, figsize=(4, 4))[source]#
Create a Venn diagram to visualize set overlaps.
For 2 or 3 sets this draws area-proportional circles via
matplotlib-venn(venn2/venn3) so the numbers sit inside clean, correctly scaled regions instead of the non-proportional ellipses of thevennpackage. This follows the approach of cnsplots (Farid Rashidi, BSD-3-Clause); the implementation here is independent.matplotlib-vennonly supports 2 or 3 sets, so 4+ sets fall back to thevenny4pybackend.- Parameters:
sets (dict) – Dictionary mapping set names to Python sets. 2 or 3 sets use
matplotlib-venn; 4 or more fall back tovenny4py.out (str) – Output directory for saved figure (
venny4pyfallback only).palette (str or list) – Colors for the set circles. A string such as
'bgrc'is treated as a sequence of single-letter matplotlib colors; a list is used as-is.ax (matplotlib.axes.Axes or bool) – Existing axes to draw into; if
Falsea new figure/axes is created.ext (str) – Output file extension (
venny4pyfallback only).dpi (int) – Resolution of saved image (
venny4pyfallback only).fontsize (float or None) – Font size for the subset counts and set names. When
Noneit followsplt.rcParams['font.size']so the labels match the rest of a figure rather than a hard-coded size.bbox_to_anchor (tuple) – Legend anchor position (
venny4pyfallback only).nc (int) – Number of legend columns (
venny4pyfallback only).cs (float) – Legend font size (
venny4pyfallback only).figsize (tuple) – Figure size used when
axisFalseand a new figure is created.
- Returns:
The axes the diagram was drawn into (or the passed-in
ax).- Return type: