Can I draw a broken axis plot with the seabed?
I need to draw a broken x-axis graph (like the graph below) with existing data, my question is, can the seaborn API be used to do this?
+3
TPWang
source
to share
1 answer
Not as pretty as I would like, but it works.
%matplotlib inline # If you are running this in a Jupyter Notebook.
import seaborn as sns
import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(0, 20, 500)
y = np.sin(x)
f, (ax1, ax2) = plt.subplots(ncols=2, nrows=1, sharey=True)
ax = sns.tsplot(time=x, data=y, ax=ax1)
ax = sns.tsplot(time=x, data=y, ax=ax2)
ax1.set_xlim(0, 6.5)
ax2.set_xlim(13.5, 20)
0
Unapiedra
source
to share