1

I've got a few figures that I'm saving to a PDF file with Matplotlib's PdfPages backend. Unfortunately some of my figures are being inserted into the PDF file with a good portion of the y axis labels truncated. How do I specify that additional space should be added to avoid the label truncation? I've tried invoking the subplot_adjust command and passing left= and pad= parameters to no avail.

Any additional suggestions are most welcome!

Chris

0

2 Answers 2

1

When you save your pdf using plt.savefig, use bbox_inches and pad_inches parameters to specify padding:

plt.savefig('test.pdf', bbox_inches='tight', pad_inches=1)
Sign up to request clarification or add additional context in comments.

Comments

0

This works for me:

fig = plt.figure(figsize=(5,3.5))
fig.subplots_adjust(bottom=0.2)
ax = fig.add_subplot(111)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.