Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
665 views
in Technique[技术] by (71.8m points)

python - Matplotlib savefig into different pages of a PDF

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

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

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

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...