本文简要介绍 python 语言中 matplotlib.backends.backend_pgf.PdfPages
的用法。
-
基础:
object
使用 pgf 后端的多页 PDF 文件
例子
>>> import matplotlib.pyplot as plt >>> # Initialize: >>> with PdfPages('foo.pdf') as pdf: ... # As many times as you like, create a figure fig and save it: ... fig = plt.figure() ... pdf.savefig(fig) ... # When no figure is specified the current figure is saved ... pdf.savefig()
创建一个新的PdfPages 对象。
- 参数:
- filename str 或 path-like
-
使用
PdfPages.savefig
的绘图将被写入此位置的文件中。任何同名的旧文件都会被覆盖。 - keep_empty 布尔值,默认值:真
-
如果设置为 False,则在关闭时将自动删除空的 pdf 文件。
- metadata 字典,可选
-
信息字典对象(参见 PDF 参考第 10.2.1 节“文档信息字典”),例如:
{'Creator': 'My software', 'Author': 'Me', 'Title': 'Awesome'}
.标准 key 是'Title'、'Author'、'Subject'、'Keywords'、'Creator'、'Producer'、'CreationDate'、'ModDate'和'Trapped'。已为 'Creator'、'Producer' 和 'CreationDate' 预定义值。可以通过将它们设置为
None
来删除它们。请注意,LaTeX 引擎的某些版本可能会忽略 'Producer' 键并将其设置为自己。
用法
class matplotlib.backends.backend_pgf.PdfPages(filename, *, keep_empty=<object object>, metadata=None)
相关用法
- Python matplotlib PdfPages用法及代码示例
- Python matplotlib PolyQuadMesh.set_hatch用法及代码示例
- Python matplotlib PolyCollection.sticky_edges用法及代码示例
- Python matplotlib PathCollection.set_hatch用法及代码示例
- Python matplotlib PatchCollection.sticky_edges用法及代码示例
- Python matplotlib PolyCollection.set_hatch用法及代码示例
- Python matplotlib PatchCollection.set_hatch用法及代码示例
- Python matplotlib PolyQuadMesh用法及代码示例
- Python matplotlib PathCollection.legend_elements用法及代码示例
- Python matplotlib PsfontsMap用法及代码示例
- Python matplotlib PolyQuadMesh.sticky_edges用法及代码示例
- Python matplotlib PathCollection.sticky_edges用法及代码示例
- Python matplotlib Patch.set_hatch用法及代码示例
- Python matplotlib Patch.contains_point用法及代码示例
- Python matplotlib PickEvent用法及代码示例
- Python matplotlib axvspan用法及代码示例
- Python matplotlib Axes.get_legend_handles_labels用法及代码示例
- Python matplotlib AbstractMovieWriter用法及代码示例
- Python matplotlib triplot用法及代码示例
- Python matplotlib StarPolygonCollection.set_hatch用法及代码示例
- Python matplotlib Axes.hist用法及代码示例
- Python matplotlib boxplot用法及代码示例
- Python matplotlib subplots用法及代码示例
- Python matplotlib InsetPosition用法及代码示例
- Python matplotlib ToolManager.toolmanager_disconnect用法及代码示例
注:本文由纯净天空筛选整理自skytowner.com大神的英文原创作品 matplotlib.backends.backend_pgf.PdfPages。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。