I need to add a pandas dataframe to a pdf and also should write some info about it in the pdf. I have successfully completed in writing a pandas dataframe to a pdf .
Below is my code:
fig,ax=plt.subplots(figsize=(20,10))
ax.axis('tight')
ax.axis('off')
the_table=ax.table(cellText=df.values,colLabels=df.columns,loc='center')
pp=PdfPages("foo.pdf")
pp.savefig(fig,bboc_inches='tight')
pp.close()
The output PDF has a dataframe printed on it.
What should I do to add some more informations on it which is not a dataframe ?(Eg:I want to add Headings,Informations on it which are sentences)
I want to convert to pdf using matplotlib/Fpdf. Using Fpdf I can add sentences but not a table . So I used matplotlib.
Please give me an idea on how to do that. Thanks a lot!

plt.text? Check thisxandyare the actual x-axis and y-axis values. So if you give a value that does not exist in the view of your graph, then the text is moved out of view. To clarify, if your graph containsxlimfrom[0, 10], you need the parameterxto be within this limit