Matplotlib savefig 到 PDF 的不同页面 [英] Matplotlib savefig into different pages of a PDF

查看:36
本文介绍了Matplotlib savefig 到 PDF 的不同页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个很长的情节,由组织成一列的几个水平子情节组成.

I have a lengthy plot, composed o several horizontal subplots organized into a column.

当我调用 fig.savefig('what.pdf') 时,生成的输出文件显示所有的图都挤在一个页面上.

When I call fig.savefig('what.pdf'), the resulting output file shows all the plots crammed onto a single page.

问题:有没有办法告诉 savefig 保存任意数量(可能是自动确定的)pdf 页面?

Question: is there a way to tell savefig to save on any number (possibly automatically determined) of pdf pages?

如果可能的话,我宁愿避免多个文件,然后是 os.system('merge ...').

I'd rather avoid multiple files and then os.system('merge ...'), if possible.

推荐答案

我自己没有尝试过,但是在 matplolib faq 中有一些说明可以将绘图保存在 pdf 中的几页中.

I haven't tried myself, but in the matplolib faq there are some instruction to save plots in pdf in several pages.

这篇关于Matplotlib savefig 到 PDF 的不同页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆