cdlib.viz.plot_event_radars¶
- cdlib.viz.plot_event_radars(lc: LifeCycle, set_name: str, min_branch_size: int = 1, colors: object | None = None)¶
绘制给定事件集在两个方向上的事件权重雷达图。
- Parameters:
lc – 生命周期对象
set_name – 事件集名称,例如“0_2”
min_branch_size – 被视为分支的最小大小,默认为1
colors – 雷达的颜色,默认为 None
- Returns:
无
- Example:
>>> from cdlib import TemporalClustering, LifeCycle >>> from cdlib import algorithms >>> from cdlib.viz import plot_flow >>> import matplotlib.pyplot as plt >>> 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") >>> plot_event_radars(events, "0_2") >>> plt.show()