【发布时间】:2011-12-23 02:36:34
【问题描述】:
我使用的是 Mac OSX,但我需要一种独立于平台的方法来打印 pdf 文件。 我在 Matplotlib 中创建了一个图表,并希望将其打印到我的打印机上。
我可以设置画布的方向以适应纵向布局:
fig.set_size_inches( 8.27,11.69) # set the figure size in inches
但使用:
fig.set_size_inches( 11.69, 8.27)
打印裁剪后的纵向图形
我在这里的另一篇文章中找到了这个:
import subprocess
import shlex
printfile='test.pdf'
fig.savefig(printfile)
proc=subprocess.Popen(shlex.split('lpr {f}'.format(f=printfile)))
谁能帮我设置将打印方向设置为横向的代码格式?
【问题讨论】:
标签: python pdf printing matplotlib