擅长:python、mysql、java
<p>是否考虑过先绘制Matplotlib表,然后导出表图形?</p>
<pre><code>import matplotlib.backends.backend_pdf
import matplotlib.pyplot as plt
import pandas as pd
d = {'x{}'.format(i): range(30) for i in range(10)}
table = pd.DataFrame(d)
fig = plt.figure()
ax=fig.add_subplot(111)
cell_text = []
for row in range(len(table)):
cell_text.append(table.iloc[row])
ax.table(cellText=cell_text, colLabels=table.columns, loc='center')
ax.axis('off')
pdf = matplotlib.backends.backend_pdf.PdfPages("output.pdf")
pdf.savefig(fig)
pdf.close()
</code></pre>
<p>我发现这是简单的,高度可定制和操作系统独立(据我所知)。我可以在客户端的服务器上实现这一点,而无需下载任何附加包。</p>