On Tue, Mar 8, 2011 at 4:51 AM, Andrea Crotti <andrea.crott...@gmail.com>wrote:
> Goyo <goyod...@gmail.com> writes:
>
> >
> > As Ben explained you need to draw first. So the usual path is:
> > 1. Draw
> > 2. Figure out the size of potentially problematic things (labels,
> > titles...) and the space you need.
> > 3. Adjust subplots or whatever needs adjustment to fit.
> > 4. Draw again.
> >
> > Sort of weird but it works and I think it's widely used.
> >
> > Goyo
>
> Sorry if I'm annoying, but is there any example about that?
> For the text I didn't find anything using bbox_patch to compute the size
> and then adapt the size of it, unless I'm blind maybe it would be nice
> to add in the website for the future...
>
>
There is an example for doing something similar, but for tick labels.
Hopefully this might be a good demonstration of the concept:
http://matplotlib.sourceforge.net/faq/howto_faq.html#automatically-make-room-for-tick-labels
Seeing this code just reminds me just how messy it is to deal with
auto-layouts...
> And also if I create an object of type matplotlib.Text.text how do I
> actually attach it to my current figure?
>
>
Because a Text object is derived from Artist, I believe you can use
add_artist() to attach your Text object to an axes object (I haven't tried
this personally).
Ben Root
------------------------------------------------------------------------------
What You Don't Know About Data Connectivity CAN Hurt You
This paper provides an overview of data connectivity, details
its effect on application quality, and explores various alternative
solutions. http://p.sf.net/sfu/progress-d2d
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users