cdlib.viz.plot_event_radar¶
- cdlib.viz.plot_event_radar(lc: LifeCycle, set_name: str, direction: str, min_branch_size: int = 1, rescale: bool = True, color: str = 'green', ax: object | None = None)¶
Plot the radar of event weights for a given event set.
- Parameters:
lc – the lifecycle object
set_name – the event set name, e.g. “0_2”
direction – the direction of the event set, either “+” or “-”
min_branch_size – the minimum size of a branch to be considered, defaults to 1
rescale – rescale the radar to the maximum value, defaults to True
color – the color of the radar, defaults to “green”
ax – the matplotlib axis, defaults to None
- Returns:
the matplotlib axis
- Example:
>>> from cdlib import TemporalClustering, LifeCycle >>> from cdlib import algorithms >>> from cdlib.viz import plot_flow >>> from networkx.generators.community import LFR_benchmark_graph >>> tc = TemporalClustering() >>> for t in range(0, 10): >>> g = LFR_benchmark_graph( >>> n=250, >>> tau1=3, >>> tau2=1.5, >>> mu=0.1, >>> average_degree=5, >>> min_community=20, >>> seed=10, >>> ) >>> coms = algorithms.louvain(g) # here any CDlib algorithm can be applied >>> tc.add_clustering(coms, t) >>> events = LifeCycle(tc) >>> events.compute_events("facets") >>> fig = plot_event_radar(events, "0_2", "+") >>> fig.show()