How to better emulate this broken line polt with matplotlib or seaborn?
23:19 11 Jan 2026

What I want to achive is something as below:

rexult

I have found the brokenaxes package at here, and the try:


from brokenaxes import brokenaxes
import numpy as np

bax = brokenaxes(xlims=((0, 10), (195, 200)), hspace=.05)
x1 = np.linspace(0, 10, 100)
x2 = np.linspace(195, 200, 100)
bax.plot(x1, np.sin(x1), label='Part 1')
bax.plot(x2, np.cos(x2), label='Part 2')
bax.legend()
plt.show()

code

However, it only broke the axes, without the tier. Is thae eleagannt method to achieve something like this? Maybe this kind of figure has ite nane, I don't find that.

python matplotlib seaborn