Reverse y-axis?

There’s no single function to do it, but just reversing the current ylimits manually is a one-liner. (“plt” is “matplotlib.pyplot”, here)


Hope that helps,


On Fri, Jun 25, 2010 at 6:41 AM, Preben Randhol <randhol@…3174…> wrote:


I need to plot some data vs depth. In stead of giving depths as

0,-1000,-2000, I want to give the depths as 0,1000,2000 but when plotting

the data goes downwards (as if they had been negative). Can I get the

y-axis to reverse so it goes downwards and not upwards?

ThinkGeek and WIRED’s GeekDad team up for the Ultimate

GeekDad Father’s Day Giveaway. ONE MASSIVE PRIZE to the

lucky parental unit. See the prize list and enter to win:

Matplotlib-users mailing list