On Fri, Jan 6, 2012 at 4:56 AM, Skipper Seabold <jsseab...@gmail.com> wrote:
> but when I call show, it seems the width of
> the box is reset.

Yes. Because the location of the texts are backend-dependent, the
location of the xbox surrounding the text are recalculated during the
drawing time. I don't think there is no easy workaround unfortunately.

If you are experienced in matplotlib, you may try is to rewrite the
get_path method of the bbox. The example code below, while a bit
complicated, tries to make the the bbox align with the axes.


ax.title.set_ha("left")
bbox_get_path = bbox.get_path
def my_get_path():
    pad = bbox.get_boxstyle().pad*bbox.get_mutation_scale()
    x0, y0 = bbox.get_transform().transform_point((0,0))
    xx = ax.bbox.x0 - x0
    bbox.set_x(xx+pad)
    bbox.set_width(ax.bbox.width-2*pad)
    return bbox_get_path()
bbox.get_path = my_get_path

regards,

-JJ

------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to