回答此问题可获得 20 贡献值,回答如果被采纳可获得 50 分。
<p>我有一个用于绘制子图的脚本,非常适合绘制条形图。当我将这个脚本与plotfile函数一起使用时,结果只是一个绘图在另一个绘图之上。基本上它只是显示了第二个情节。原因是什么?你知道吗</p>
<pre><code>import matplotlib
matplotlib.use('Agg')
import matplotlib.pylab as plt
import numpy as np
import matplotlib.ticker as mtick
from operator import add
matplotlib.rcParams.update({'font.size': 16})
fig = plt.figure(figsize=(11,10))
plt.subplots_adjust(left=None, bottom=None, right=None, top=None, wspace=0.13, hspace=0.15)
ax1=fig.add_subplot(211)
plt.plotfile('2m_5m_stringsearch', delimiter=' ', cols=(0, 1), color='green', linewidth= 1.5, linestyle='-.',dashes=(5,8), marker='', label='stringsearch')
plt.ylim(0,1)
ax1.set_xticklabels([])
plt.ylabel('SER of Leon3-C1')
ax2=fig.add_subplot(212)
plt.plotfile('2m_5m_stringsearch', delimiter=' ', cols=(0, 1), color='green', linewidth= 1.5, linestyle='-.',dashes=(5,8), marker='', label='stringsearch')
plt.ylim(0,1)
ax2.set_xticklabels([])
plt.ylabel('SER of Leon3-C2')
plt.savefig("Output.pdf", dpi=400, bbox_inches='tight', pad_inches=0.05)
</code></pre>