Skip to content

Commit 13baf2a

Browse files
authored
Merge pull request #17 from NNPDF/savefig_workaround
minor change as a global workaround for NNPDF/nnpdf#363
2 parents 2eec5f3 + a3b7e07 commit 13baf2a

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/reportengine/figure.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ def savefig(fig, *, paths, output ,suffix=''):
6363

6464
#Numpy can produce a lot of warnings while working on producing figures
6565
with np.errstate(invalid='ignore'):
66-
fig.savefig(str(path), bbox_inches='tight')
66+
fig.tight_layout()
67+
fig.savefig(str(path))
6768
outpaths.append(path.relative_to(output))
6869
plt.close(fig)
6970
return Figure(outpaths)
@@ -94,4 +95,4 @@ def figure(f):
9495
def figuregen(f):
9596
f.prepare = prepare_paths
9697
f.final_action = savefiglist
97-
return f
98+
return f

0 commit comments

Comments
 (0)