From a69a005aaebde2e1e69d1e3c2cb1460e0bf85e70 Mon Sep 17 00:00:00 2001 From: Daniel Davies Date: Fri, 19 Mar 2021 15:58:36 +0000 Subject: [PATCH] add bbox_inches tight to savefig commands --- surfaxe/io.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/surfaxe/io.py b/surfaxe/io.py index 4fcfb90..846c4c8 100644 --- a/surfaxe/io.py +++ b/surfaxe/io.py @@ -224,7 +224,7 @@ def plot_bond_analysis(bond, df=None, filename=None, width=6, height=5, dpi=300, ax.set_ylabel("Bond distance / Å") ax.legend(['{}-{} bond'.format(bond[0], bond[1])]) plt.xlabel("Fractional coordinate in c") - fig.savefig(plt_fname, facecolor='w') + fig.savefig(plt_fname, facecolor='w', bbox_inches='tight') def plot_electrostatic_potential(df=None, filename=None, dpi=300, width=6, @@ -268,7 +268,7 @@ def plot_electrostatic_potential(df=None, filename=None, dpi=300, width=6, ax.axes.xaxis.set_visible(False) ax.legend() plt.ylabel('Potential / eV') - fig.savefig(plt_fname, facecolor='w') + fig.savefig(plt_fname, facecolor='w', bbox_inches='tight') def plot_surfen(df, joules=True, time_taken=True, colors=None, dpi=300, width=6, height=5, heatmap=False, cmap='Wistia', plt_fname='surface_energy.png'):