本文簡要介紹 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。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。