From f0d1bf51310660cfeab1b370ff35221801dd5073 Mon Sep 17 00:00:00 2001 From: Randy LeVeque Date: Sat, 18 Apr 2020 11:53:49 -0700 Subject: [PATCH] improve margins on savefig command for kml --- src/python/visclaw/frametools.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/python/visclaw/frametools.py b/src/python/visclaw/frametools.py index 8678d250..8d8c24e0 100644 --- a/src/python/visclaw/frametools.py +++ b/src/python/visclaw/frametools.py @@ -1077,10 +1077,14 @@ def printfig(fname='',frameno='', figno='', format='png', plotdir='.', \ a.set_yticks([]) plt.axis('off') + if kml_figsize is not None: fig.set_size_inches(kml_figsize[0],kml_figsize[1]) - plt.savefig(fname, transparent=True, bbox_inches='tight', \ - pad_inches=0,dpi=kml_dpi) + a.set_frame_on(False) + plt.subplots_adjust(top = 1, bottom = 0, right = 1, left = 0, + hspace = 0, wspace = 0) + plt.margins(0,0) + plt.savefig(fname, transparent=True, bbox_inches='tight',dpi=kml_dpi) else: plt.savefig(fname, bbox_inches=bbox_inches)