Skip to content

Commit

Permalink
add bbox_inches tight to savefig commands
Browse files Browse the repository at this point in the history
  • Loading branch information
dandavies99 committed Mar 19, 2021
1 parent 55e4010 commit a69a005
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions surfaxe/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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'):
Expand Down

0 comments on commit a69a005

Please sign in to comment.