!pip install reportlab
from reportlab.pdfgen import canvas
from reportlab.lib.pagesizes import A4
from reportlab.platypus import SimpleDocTemplate, Paragraph, Image, PageBreak
from reportlab.lib.styles import getSampleStyleSheet
sample_style_sheet = getSampleStyleSheet()
c = SimpleDocTemplate('test.pdf', pagesize=A4)
flowables = []
s = sample_style_sheet['Normal']
paragraph_1 = Paragraph("A title", sample_style_sheet['Heading1'])
paragraph_2 = Paragraph("Some normal body text", sample_style_sheet['BodyText'])
x =[1,2,3,4]
txt=('This is a list %s' %(x))
print(txt)
paragraph_3 = Paragraph(txt, s)
flowables.append(paragraph_1)
flowables.append(paragraph_2)
flowables.append(paragraph_3)
plt.savefig('tstpng',format='png')
flowables.append(Image('tstpng'))
#flowables.append(PageBreak())
c.build(flowables) # erst am Ende, wenn alles geschrieben ist, das zu schreiben war