除了隐藏每个元素,您还可以隐藏整个轴:
frame1.axes.get_xaxis().set_visible(False)frame1.axes.get_yaxis().set_visible(False)
或者,您可以将刻度线设置为空列表:
frame1.axes.get_xaxis().set_ticks([])frame1.axes.get_yaxis().set_ticks([])
在第二个选项中,您仍然可以使用
plt.xlabel()和
plt.ylabel()在轴上添加标签。

除了隐藏每个元素,您还可以隐藏整个轴:
frame1.axes.get_xaxis().set_visible(False)frame1.axes.get_yaxis().set_visible(False)
或者,您可以将刻度线设置为空列表:
frame1.axes.get_xaxis().set_ticks([])frame1.axes.get_yaxis().set_ticks([])
在第二个选项中,您仍然可以使用
plt.xlabel()和
plt.ylabel()在轴上添加标签。