pythonic生物人

师兄师姐都在偷偷用!这个工具出手就是PNS级水准!

Matplotlib、seaborn很强,但是,参数繁多 2026可视化工具TOP3 matplotlib的强力扩展UltraPlot,它是Python matplotlib繁杂参数的简化包装,少许代码,轻松实现publication-quality plots。

使用一下UltraPlot

  • Chord diagram
ax.chord_diagram(matrix, ticks_interval=None, space=4)
  • Ridge Plot
ax.ridgeline(data, labels=labels, overlap=0.1, cmap="managua")
  • 等高线 + heatmap
ax.contourf(df, cmap="YlOrRd", colorbar="t", lw=0.7, ec="k")
  • 上三角heatmap
ax.heatmap(
    data,
    cmap="ColdHot",
    vmin=-1,
    vmax=1,
    N=100,
    lw=0.5,
    ec="k",
    labels=True,
    precision=2,
    labels_kw={"weight": "bold"},
    clip_on=False,  # turn off clipping so box edges are not cut in half
)
  • 流向图

fig, ax = uplt.subplots(refwidth=6.3)
ax.ribbon(
    df,
    id_col="country",
    period_col="period",
    topic_col="topic",
    period_order=periods,
    topic_order=topic_order,
    group_map=TOPIC_TO_GROUP,
    group_order=group_order,
    group_colors=GROUP_COLORS,
)

network
nodes, edges, labels = ax.graph(
    g,
    layout="spring",
    layout_kw={"seed": 4},
    node_kw={
        "node_color": degrees,
        "cmap": "viko",
        "edgecolors": "black",
        "linewidths": 0.6,
        "node_size": 128,
    },
    edge_kw={
        "alpha": 0.4,
        "width": [np.random.rand() * 4for _ in range(len(g.edges()))],
    },
    label_kw={"font_size": 7},
)
更多。。。。。。

装一下UltraPlot

pip install ultraplot
conda install -c conda-forge ultraplot
更多。。。。。。 👉 《保姆级R可视化教程4.0》来了!
图片
图片

👉 matplotlib教程:20w字+数百张图形+1W行代码+详细代码注释+学习交流群

图片

👉 seaborn教程:12.3万字+500多张图形+8000行代码

图片

加入学习?

👇(请 备注: 299 )
图片