Hi,

I guess the extent of the rendered text is not known until the figure
is drawn. The link below would be helpful.

http://matplotlib.sourceforge.net/doc/html/faq/howto_faq.html#how-do-i-automatically-make-room-for-my-tick-labels

So. it is possible to know the text length, but you need to wait until
the drawing time.

I guess the legend class might be helpful, as it adjust its position
at the drawing time according to the text size. But wrapping a text
(in general way) seems not easy to me.

Anyhow, the easiest way I can think of is to rely on LaTeX for wrapping.

  text(0.5, 2.5, r"\parbox[b]{2 in}{really really really really really
really long line}", va="top")

It may be a bit tricky to get the right vertical alignment though.

Regards,

-JJ



On Thu, Aug 21, 2008 at 12:55 PM, Ben Axelrod <[EMAIL PROTECTED]> wrote:
> I am trying to draw some text inside of a rectangle.  The text can be longer
> than the rectangle, so I would like to wrap the text.  I doubt MPL has this
> kind of functionality built in, so I am expecting to write it myself.
>
>
>
> I think I read somewhere that it is not possible to get the length of text
> in MPL.  Is this true?   This would be the basic mechanism needed to
> implement this.
>
>
>
> I just want to know if this is possible or not, and any pointers if anyone
> has some.
>
>
>
> Thanks,
>
> -Ben
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to