本文整理汇总了Python中matplotlib.backends.backend_pdf.PdfPages.get_pagecount方法的典型用法代码示例。如果您正苦于以下问题:Python PdfPages.get_pagecount方法的具体用法?Python PdfPages.get_pagecount怎么用?Python PdfPages.get_pagecount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类matplotlib.backends.backend_pdf.PdfPages
的用法示例。
在下文中一共展示了PdfPages.get_pagecount方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: len
# 需要导入模块: from matplotlib.backends.backend_pdf import PdfPages [as 别名]
# 或者: from matplotlib.backends.backend_pdf.PdfPages import get_pagecount [as 别名]
"beta = {5}, lambda = {6} ({7} paths)")
title = title.format(period, GRID_STEPS[1], MINPECTSNRS[1],
CORR_LENGTHS[1], ALPHAS[1],
BETAS[1], LAMBDAS[1], len(v.paths))
fig = v.plot(title=title, showplot=False)
# appending fig to figures of period
periodfigs.append(fig)
# exporting figs to pdf
for fig in periodfigs:
pdf.savefig(fig)
plt.close(fig)
# closing pdf file
pagenbs = range(pdf.get_pagecount())
pdf.close()
# merging pages of pdf with similar period
key = lambda pagenb: int(pagenb / 3) # grouping pages 0-1-2, then 3-4-5 etc.
#pagesgroups = psutils.groupbykey(pagenbs, key=key)
#print "\nMerging pages of pdf..."
#psutils.combine_pdf_pages(pdfname, pagesgroups, verbose=True)
# exporting final maps (using pickle) as a dict:
# {period: instance of pstomo.VelocityMap}
print "\nExporting final velocity maps to file: " + picklename
f = psutils.openandbackup(picklename, 'wb')
pickle.dump(vmaps, f, protocol=2)
f.close()