How to Invert the Y-Axis in Matplotlib (invert_yaxis, ylim, imshow, twinx)
To invert the y-axis in Matplotlib, call ax.invert_yaxis() on your axes, or plt.gca().invert_yaxis() if you use the pyplot interface. On an inverted y-axis the values grow downward instead of upward, so the smallest value is at the top. That’s what you want for rankings (1 at the top), depth, screen/pixel coordinates and horizontal bar charts … Read more >>