I would like to align my suptitle in the top left-hand corner on each page of the multiple PDF document I am trying to create, however, it doesn't seem to be doing as I try to ask. The below script produces the suptitle in the top and centre. I cannot figure out what I am doing wrong:
import datetime
import numpy as np
from matplotlib.backends.backend_pdf import PdfPages
import matplotlib.pyplot as plt
pdf = PdfPages('TestPDF.pdf')
Countries = ['Argentina', 'Australia']
for country in Countries:
fig = plt.figure(figsize=(4, 5))
fig.set_size_inches([10, 7])
plt.suptitle(country, horizontalalignment='left', verticalalignment='top',
fontsize = 15)
x = 1000
plt.plot(x, x*x, 'ko')
pdf.savefig()
plt.close(fig)
pdf.close()
Strangely:
verticalalignment='bottom'
only shifts the suptitle higher (and off the top of the page slightly), which makes me think that it is aligning itself off different boundaries than the edges of the page?