0

I am trying to plot a dataframe as a table and save it to pdf. I am able to save figures to pdf using this example https://matplotlib.org/examples/pylab_examples/multipage_pdf.html. I can also plot the table I want but not save it to pdf. : enter image description here

I an trying with

fig_stats = plt.figure(figsize=(12, 9))
fig_stats = ff.create_table(df_stats)
plt.title('Derived features')
#txt = 'this is an example'
plt.text(0.05, 0.95, txt, transform=fig_stats.transFigure, size=24)
pdf.savefig()
plt.close()

but I am not allowed to save this to a pdf, I get AttributeError: 'Figure' object has no attribute 'transFigure' I also tried with Matplotlibs own table generator, but neither works. I would really appreciate being able to use the PdfPages package as I also need to plot some figures in the same pdf. Any ideas as to what I am doing wrong ? Thanks in advance

3

0

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.