neuralib.plot.venn.VennDiagram
- class neuralib.plot.venn.VennDiagram[source]
Bases:
object- DEFAULT_COLORS: ClassVar[tuple[str, ...]] = ('r', 'g', 'b')
- __init__(subsets, *, colors=None, ax=None, **kwargs)[source]
- Parameters:
subsets (dict[str, int]) – Dictionary of set label and its value
colors (tuple[str, ...] | None) – colors of each venn
ax (Axes | None) –
Axeskwargs – additional args passed to
matplotlib_venn.venn2()ormatplotlib_venn.venn3()
- property intersections: dict[str, int]
intersection for sets
- property max_intersection_areas
maximal number of intersection areas
- property labels: tuple[str, ...]
set names
- property subsets_percentage: dict[str, float]
percentage of each subset
- add_total(value)[source]
Add total value to the venn diagram :param value: value to be added
- Parameters:
value (int)
- add_intersection(group, value)[source]
Add intersection values using “&”
- Parameters:
group (str) – i.e., a & b
value (int) – value of the intersection
- get_intersection(*label)[source]
Get intersection value from labels
:param label:i.e., a & b :return: intersection value
- Parameters:
label (str)
- Return type:
int
- plot(add_title=True)[source]
Plot the venn diagram
- Parameters:
add_title (bool) – Add percentage information and total as title
- static savefig(output)[source]
Save figure
- Parameters:
output (str | Path | bytes | BinaryIO | BufferedIOBase | BufferedReader) – fig output
- property title: str
title of the plot