import matplotlib.pyplot as plt
ax1 = plt.subplot(321) # 1st subplot in 3-by-2 grid
ax1.plot(...) # draw what you want
ax1.set_xticks([], []) # note you need two lists one for the positions and one for the labels
ax1.set_yticks([], []) # same for y ticks
ax2 = plt.subplot(321) # 2nd subplot in the same grid
# do the same thing for any subplot you want the ticks removed
您可以使用plt.tick_params选项微调绘图:
你的图中有很多子图。您需要删除每个子批次的每个轴对象中的记号(或者至少要删除要显示的标记)。可以这样做:
如果要删除整个轴(边框、记号和标签),只需执行以下操作:
^{pr2}$不过,我建议键入
plt.tight_layout()
。它可以解决您的问题,而不需要您删除勾号。在相关问题 更多 >
编程相关推荐