On Tue, Jul 28, 2009 at 10:27 PM, Kun Hong<kun.h...@uqconnect.edu.au> wrote:
> Hi,
>
> I am new to matplotlib. Currently I have a need to change the subplot
> orders after the subplts have been added to a figure. I haven't found a
> way to do it easily. One of my solution is to keep an ordered list of
> the subplots and re-add them in the correct order. But this way, all the
> navigation information (zoom/pan) is lost. Another way I found is to
> get the positions (get_position method of Axes) of the subplot and
> then set the positions according to the new order, which is quite
> cumbersom. I am thinking if there is a similar method like add_subplot
> (that is, accepting new positional information of row, column, number
> instead of Bbox), it will be great. Does anyone know any better
> solution?

It should work to call ax.change_geometry on the existing subplot instances.

  
http://matplotlib.sourceforge.net/api/axes_api.html#matplotlib.axes.SubplotBase.change_geometry

Haven't tested it for this use case, but I'm pretty sure it will do
what you want.  Let me know!

JDH

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to