【发布时间】:2022-12-12 06:15:58
【问题描述】:
我创建了一个包含多行和多列的子图,它们共享它们的 x 轴。 删除最右下方的 ax 后,其上方的 ax 不显示 x 轴值。如何使这些 x 轴值在此轴上可见?
我不想要的是稍后必须添加最右上角的斧头。
from matplotlib import pyplot as plt
fig, ax = plt.subplots(2, 3, sharex=True, sharey=True)
fig.tight_layout()
fig.delaxes(ax[1, 2])
plt.show()
这就是我得到的:
我试过这样的事情:
ax[0,2].xaxis.set_visible(True)
ax[0,2].set_xticks([0, 0.25, 0.5, 0.75, 1])
ax[0,2].set_xticklabels([0, 0.25, 0.5, 0.75, 1])
但这些都没有帮助。 谢谢!
【问题讨论】:
标签: python matplotlib graph