how to invert x and y axis matplotlib code example Example: invert y axis python plt.gca().invert_yaxis()