【发布时间】:2025-12-14 21:55:01
【问题描述】:
我需要用现有数据绘制一个断开的 x 轴图(例如下图),我的问题是是否可以使用 seaborn API 来做到这一点?
【问题讨论】:
-
这对 seaborn 也有效吗?看起来 seaborn plot 自己生成了 plot 对象,我可以替换这里生成的 matplotlib 对象:
f, (ax, ax2) = plt.subplots(2, 1, sharex=True) -
由于 seaborn 完全建立在 matplotlib 之上,所以它肯定可以工作。细节取决于您的实施。
-
这里给出的答案对我来说效果很好,包括使用 seaborn:gist.github.com/pfandzelter/0ae861f0dee1fb4fd1d11344e3f85c9e
标签: python matplotlib plot axis seaborn