我将matplotlib设置为在绘图区域之外放置刻度,但现在它们重叠在相应的标签上。 tick_params方法没有提供任何选项来设置相应标签的位置。因此,我想我将不得不使用text()方法编写自己的函数。同时,有没有更好的建议?
使用pad来相对于刻度移动刻度标签。比较ax.tick_params(direction='out', pad=5) plt.draw() 用ax.tick_params(direction='out', pad=15) plt.draw()