# reversing the y axis

hi. i'm a new user of matplotlib. i've searched through the arhieves
of the mailing list but couldn't find a quick solution. i simply need
to reverse the y axis of my plots. for example in a range of 0-10, 0
must seem at the top of the plot where 10 is lowest, near to the x
axis. is there a quick solution for this. (x axis must stay as it is)

thanx...

···

--
EMRE AYDIN
emraydin@...287...

ylim(10, 0)

JDH

···

On 8/24/07, Emre Aydın <emraydin@...287...> wrote:

hi. i'm a new user of matplotlib. i've searched through the arhieves
of the mailing list but couldn't find a quick solution. i simply need
to reverse the y axis of my plots. for example in a range of 0-10, 0
must seem at the top of the plot where 10 is lowest, near to the x
axis. is there a quick solution for this. (x axis must stay as it is)

# Get min and max from current axes
y_min, y_max = gca().get_ylim()

# Set the other way round for current axes
gca().set_ylim(y_max, y_min)

# Redraw
draw()

Emre Ayd?n wrote:

···

hi. i'm a new user of matplotlib. i've searched through the arhieves
of the mailing list but couldn't find a quick solution. i simply need
to reverse the y axis of my plots. for example in a range of 0-10, 0
must seem at the top of the plot where 10 is lowest, near to the x
axis. is there a quick solution for this. (x axis must stay as it is)

thanx...

thnx alot! that solved it...

···

On 8/24/07, Fred Ludlow <rfl26@...776...> wrote:

# Get min and max from current axes
y_min, y_max = gca().get_ylim()

# Set the other way round for current axes
gca().set_ylim(y_max, y_min)

# Redraw
draw()

Emre Ayd?n wrote:
> hi. i'm a new user of matplotlib. i've searched through the arhieves
> of the mailing list but couldn't find a quick solution. i simply need
> to reverse the y axis of my plots. for example in a range of 0-10, 0
> must seem at the top of the plot where 10 is lowest, near to the x
> axis. is there a quick solution for this. (x axis must stay as it is)
>
> thanx...
>

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
EMRE AYDIN
emraydin@...287...