You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Have you considered generating HTML instead of PDF, or as a preliminary to
it?
One benefit of HTML is that you could include charts in the emailed
reports, and mixing text and images is of course not a problem. You could
always email a PDF file, but an email with images seems nicer.
Github.com can also display html files.
There are libraries available to convert HTML to PDF if you still want PDF
for some reason (although I know you don't like adding dependencies).
On Tue, Jul 12, 2022 at 7:30 AM Robert Carver @.***>
wrote:
It would be nice to have the option to output reports into a .pdf file.
That way, figures can be plotted. The use case I'm thinking of is issue #653#653 but
clearly one could use this for accounting p&l as well.
A quick check reveals that github.com can render .pdf so that is good.
with PdfPages(r'C:\Users\Ron\Desktop\Charts.pdf') as export_pdf:
plt.scatter(df1['Unemployment_Rate'], df1['Stock_Index_Price'], color='green')
plt.title('Unemployment Rate Vs Stock Index Price', fontsize=10)
plt.xlabel('Unemployment Rate', fontsize=8)
plt.ylabel('Stock Index Price', fontsize=8)
plt.grid(True)
export_pdf.savefig()
plt.close()
It also works on a headless terminal (checked).
It would be nice to include text as well, but let's park that for the
moment (can always be a seperate file).
Now, this does not fit well into the paradigm used by the reporting code
in psystemtrade. Remember, we generate a list of special objects (headers,
body_text, table) which is then 'parsed' into a single text string, which
we then email or dump to file etc.
it?
One benefit of HTML is that you could include charts in the emailed
reports, and mixing text and images is of course not a problem. You could
always email a PDF file, but an email with images seems nicer.
Github.com can also display html files.
There are libraries available to convert HTML to PDF if you still want PDF
for some reason (although I know you don't like adding dependencies).
On Tue, Jul 12, 2022 at 7:30 AM Robert Carver @.***>
wrote:
Originally posted by @tgibson11 in #680 (comment)
The text was updated successfully, but these errors were encountered: