alexras/boomslang — pull request #36 by teoryn (2013-11-16 05:02:31+00:00)
Title: Enable tight bounds with legend as extra artist

See http://stackoverflow.com/a/10154763/392880 for an example of moving the legend outside the plot. Adding plot.legend to bbox_extra_artists and bbox_inches='tight' in Plot.save() with the legend bbox_to_anchor set outside the plot works correctly.

This isn't the cleanest solution. It might be better to enable this behind the scenes so that if the legend is ever anchored outside the plot it just works. Such a case could probably access the matplotlib legend directly avoiding the get_window_extent function passing through the Legend object.