擅长:python、mysql、java
<p>更紧凑的版本(也替换了不推荐的<code>tsplot</code>)。{{{cd2>通过参数cd2}之间的距离来绘制。在</p>
<p><a href="https://i.stack.imgur.com/tcgLL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tcgLL.png" alt="enter image description here"/></a></p>
<pre class="lang-py prettyprint-override"><code>%matplotlib inline
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.lineplot(x=x, y=y, ax=ax1)
ax = sns.lineplot(x=x, y=y, ax=ax2)
ax1.set_xlim(0, 6.5)
ax2.set_xlim(13.5, 20)
plt.subplots_adjust(wspace=0, hspace=0)
</code></pre>