我有一个简单的线图,需要将 y 轴刻度从图的(默认)左侧移动到右侧。关于如何做到这一点的任何想法?
最佳答案
使用 ax.yaxis.tick_right()
例如:
from matplotlib import pyplot as plt
f = plt.figure()
ax = f.add_subplot(111)
ax.yaxis.tick_right()
plt.plot([2,3,4,5])
plt.show()
关于绘图右侧的 Python Matplotlib Y 轴刻度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10354397/