reports module¶
Generate simple pdf reports. Need rst2pdf tool (https://code.google.com/p/rst2pdf) to be installed.
Created on Wed Feb 5 21:42:54 2014
@author: Ondrej Lexa
- Example:
from polylx import * from polylx.reports import Report
g = Grains.from_shp()
fig, ax = plt.subplots() x = np.linspace(-8,8,200) ax.plot(x,np.sin(x))
r = Report(‘Test report’) r.add_chapter(‘Things will start here’) r.savefig(fig, width=‘75%’) r.table([[1,2,120],[2,6,213],[3,4,118]],
title=’Table example’, header=[‘No’,’Val’,’Age’])r.grainmap(g, width=‘75%’) r.write_pdf()
-
class
polylx.reports.
Report
(title='Report')¶ Bases:
object
-
__init__
(title='Report')¶
-
add_chapter
(title)¶
-
add_section
(title)¶
-
add_subsection
(title)¶
-
dataframe
(df, title='Table', header=None, format=None, stub_columns=None, widths=None)¶
-
figure
(filename, width=None, height=None)¶
-
fin
()¶
-
matplotlib_fig
(fig, width=None, height=None, bbox_inches='tight', dpi=150)¶
-
pagebreak
()¶
-
plot
(g, legend=None, loc='auto', alpha=0.8, dpi=150, width=None, height=None)¶
-
table
(rows, title='Table', header=None, format=None, stub_columns=None, widths=None)¶
-
transition
()¶
-
write_pdf
(file='report.pdf')¶
-
write_rst
(file='report.rst')¶
-