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)