import matplotlib.pyplot as plt import matplotlib.image as mpimg # 加载保存的图像 img = mpimg.imread('./walking_static/image.png') plt.imshow(img) # 获取当前坐标轴 ax = plt.gca() # 设置 y 轴的范围 ax.set_ylim(-3, 3) # 调整 y 轴范围 # 显示修改后的图像 plt.show()