From 2646d98609ad6991a6ffc960bbff8190ca99c291 Mon Sep 17 00:00:00 2001 From: Stefan van der Walt Date: Sat, 16 Jul 2011 11:09:23 -0500 Subject: [PATCH] DOC: Save plots with tight bounding boxes. --- doc/ext/plot_directive.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/ext/plot_directive.py b/doc/ext/plot_directive.py index d092f590..2ad1530a 100644 --- a/doc/ext/plot_directive.py +++ b/doc/ext/plot_directive.py @@ -575,7 +575,9 @@ def render_figures(code, code_path, output_dir, output_base, context, images.append(img) for format, dpi in formats: try: - figman.canvas.figure.savefig(img.filename(format), dpi=dpi) + figman.canvas.figure.savefig(img.filename(format), + dpi=dpi, + bbox_inches='tight') except exceptions.BaseException as err: raise PlotError(traceback.format_exc()) img.formats.append(format)