I generate a multipage pdf using the following code. Since I will have around 3000 plots, 10 per pages. the pdf could become uge. I though to substitute every plot with a jpg or pdf version. But I am not sure how to do it within PdfPage backend.
plots_per_page = 10
col_per_page = 1
with PdfPages('NewPDF.pdf') as pdf:
for pgg in range(0,pages):
fig = figure(figsize=(8,20) )
gs1 = gridspec.GridSpec(plots_per_page//col_per_page, col_per_page)
for i in arange(0,10):
ax = fig.add_subplot(gs1[i])
ax.bar(arange(20), random.normal(0,1,20), linewidth = 0.5)
gs1.tight_layout(fig , h_pad=0.8, w_pad=0.8)
axis('auto')
savefig(pdf, format='pdf')
close()