Recommended Free Tools
Save the Figure that contains the table—not the table artist itself. Add the table to an Axes with ax.table(...), then export the Figure with fig.savefig("table.pdf", format="pdf").
Save one Matplotlib table as a PDF
A Matplotlib table is drawn as part of a Figure. The standard export path is therefore to create the Figure and Axes, add the table to the Axes, and call savefig on the Figure. Matplotlib documents PDF as a supported output format in its Figure.savefig API and backend guide.
import matplotlib.pyplot as plt
headers = ["Name", "Score"]
rows = [["Ari", 92], ["Bea", 87]]
fig, ax = plt.subplots()
ax.axis("off") # Hide axes so the output focuses on the table.
ax.table(cellText=rows, colLabels=headers, loc="center")
fig.savefig("table.pdf", format="pdf", bbox_inches="tight")
Replace headers and rows with your own column labels and data. The .pdf extension makes the output filename clear; format="pdf" explicitly selects PDF output.
Choose the page bounds and size
bbox_inches="tight" asks Matplotlib to fit the saved bounds around the Figure’s visible artists, which can help keep table labels or cells from being clipped. You can tune the whitespace around that tight bounding box with pad_inches; the documented default is 0.1 inches. See the savefig parameters.
#1 Best Overall
If the PDF must use a predictable page size or consistent margins, set the Figure dimensions when creating it, for example with fig, ax = plt.subplots(figsize=(8, 4)). A tight bounding box can change the saved extent to fit content, so inspect the exported PDF when fixed page geometry matters. To preserve the canvas dimensions, omit bbox_inches="tight" and adjust the figure size or table layout instead.
Put multiple figures in one PDF
For a PDF with several pages, use Matplotlib’s PdfPages context manager and save each Figure as a page. The official PDF backend guide documents this approach.
Rank #2
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
with PdfPages("tables.pdf") as pdf:
for headers, rows in datasets:
fig, ax = plt.subplots()
ax.axis("off")
ax.table(cellText=rows, colLabels=headers, loc="center")
pdf.savefig(fig)
plt.close(fig)
Here, datasets should be an iterable of (headers, rows) pairs. Each call to pdf.savefig(fig) adds that Figure as a page; closing it after saving helps release resources in longer loops.
Quick Recap
Best Value
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




