Re: [Matplotlib-users] How to reverse the direction of an axis?
In [1]:plot(arange(10)) Out[1]:[matplotlib.lines.Line2D object at 0x908ee0c] In [2]:ax = gca() In [3]:ax.set_ylim(ax.get_ylim()[::-1]) Out[3]:(9.0, 0.0) In [4]:draw() In [5]: The method in line 3 should work on new and old versions of matplotlib. The basic idea is that when axis limits are set, you specify the bottom, then the top (or the right, then the left), not min and then max. Eric Daehyok Shin wrote: I like to reverse the direction of y axis - from top to bottom. Anyone to help me? I initially thought it may be easy, but it turned out much harder to find THE SOLUTION. Thanks. Daehyok Shin - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] How to reverse the direction of an axis?
I like to reverse the direction of y axis - from top to bottom. Anyone to help me? I initially thought it may be easy, but it turned out much harder to find THE SOLUTION. Thanks. Daehyok Shin - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] How to reverse the direction of an axis?
Daehyok Shin wrote: Thanks for your help. I didn't know set_ylim can the reversed limits. I am wondering if it is not a good idea to introduce a method such as axis.set_direction(). Or, axis.set_origin(). There are Axes methods invert_xaxis() and invert_yaxis() in recent versions of mpl; I don't remember who added them or when. Eric - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users