尝试使用 camelot-py 绘制 pdf table,但没有出现 table

Trying to plot a pdf table using camelot-py, but no table comes up

我正在尝试绘制 table 以进行调试并找到 table 坐标,但是该图从未出现在屏幕上。 Camelot 内置了使用 matplotlib 库绘制 table 的函数。我已经为 camelot 下载了所有依赖项,但我似乎无法弄清楚如何让图形出现。


tables = camelot.read_pdf('example.pdf', flavor = 'lattice')

print(tables[0].parsing_report)

plt = camelot.plot(tables[0], kind='grid')
plt.show()

我只需要在 .show() 函数之后添加 Tkinter .mainloop() 函数,以在我关闭它之前保持图形。没有它,图形会立即关闭,这样代码就可以 运行 一直通过。