【发布时间】:2018-02-15 13:36:32
【问题描述】:
我正在使用 matplotlib 子图。这是我的代码的骨架:
import matplotlib.pyplot as plt
from matplotlib import gridspec
plt.close('all')
f, axarr = plt.subplots(2, sharex=True,)
gs = gridspec.GridSpec(2, 1, height_ratios=[3, 1])
axarr[0] = plt.subplot(gs[0])
axarr[1] = plt.subplot(gs[1])
axarr[0].set_ylim([-10,10])
axarr[1].set_ylim([-1,1])
plt.tight_layout()
f.subplots_adjust(hspace=0)
plt.show()
如您所见,在左侧 y 轴上,我得到 ytick 标签,它们相互重叠,而右侧 y 轴上的“奇怪”y 轴刻度标签 (0)。我该如何解决这个问题?我会很感激能在这里得到帮助。
【问题讨论】:
标签: python-2.7 matplotlib