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)

plt.ylim(plt.ylim()[::-1])

Hope that helps,
-Joe

···

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

Hi

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:

http://p.sf.net/sfu/thinkgeek-promo


Matplotlib-users mailing list

Matplotlib-users@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/matplotlib-users