On Sun, Feb 27, 2011 at 6:48 AM, andrea crotti <andrea.crotti.0@gmail.com> wrote:
2011/2/18 Benjamin Root <ben.root@ou.edu>:
> Automatic layouts are difficult to do in matplotlib.  This was a design
> decision trade-off made early in its development.  Instead of having
> matplotlib determining optimal layouts and such, the developers decided that
> it would be better to give the programmers full control over all placement,
> and merely establish good defaults.
> Just for completeness, I like this page because it talks about the multiple
> different ways you can specify coordinates for a text object (and
> corresponding arrow) for placement:
> http://matplotlib.sourceforge.net/users/annotations.html
> Knowing ahead of time how much space an annotation will take is very
> difficult, especially if your text involves any LaTeX symbols.  However, it
> is possible.  The Text object has some method calls that can return bounding
> boxes for the text object after it is made:
> http://matplotlib.sourceforge.net/api/artist_api.html#matplotlib.text.Text.get_bbox_patch
> http://matplotlib.sourceforge.net/api/artist_api.html#matplotlib.text.Text.get_window_extent
> I haven't used these myself, so I don't know exactly what is the difference
> between them (I think they are different coordinate systems).  Once knowing
> the size of your text object, you can change the position of the object
> using its set_position() method.  It is tricky, but if positioning and
> layout is very important to you, it is possible to do.
> I hope this helps!
> Ben Root

Thanks for the answer, I tried something out but well it's not so trivial.
And I think it doesn't make much sense to add the text inside the same
plot, so I thought about subplot.

I want a bigger subplot on top and one are splitted in two parts below it.

But if I do
it doesn't like it, and I didn't find any example which has this "more
advanced" subplotting.

Once that works it might be easier to compute the size that I need
since the coordinate for the subplot are always from 0 to 1...


If you would like more advanced control over your subplots, matplotlib v1.0.x has the new gridspec feature:


Maybe this can help you?
Ben Root