绘图右侧的 Python Matplotlib Y 轴刻度

标签 python matplotlib

我有一个简单的线图,需要将 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()

enter image description here

关于绘图右侧的 Python Matplotlib Y 轴刻度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10354397/

相关文章:

Python 从十六进制字节创建数组

python - 如何找到运动物体轨迹中的冗余路径(子路径)?

python - 限制使用 numpy.genfromtxt 为 matplotlib 读取多少数据

python - 在散点图上绘制 matplotlib.animation 中的垂直线

python - matplotlib 子图中的行和列标题

python - 为什么我的 lambda 函数在使用像 filter() 和 map() 这样的函数时不返回任何值?

python - Tornado使用WSGI来处理python文件吗?

python - 子图与neo4j和py2neo的缓慢合并

python - 使用 FuncAnimation 在 matplotlib 中动画化等高线图

python - matplotlib 对数曲面图的对数颜色图