Questions tagged [pdfpages]

A Python method, in matplotlib, for generating a pdf with multiple pages or a Latex package for inserting external pdf documents.

is either a Python method for generating a pdf with multiple pages or a Latex package for inserting external pdf documents.

If the question relates to the Python method it should usually be tagged with both and . If it relates to the Latex package it should be tagged with .

Further reading:

60 questions
16
votes
2 answers

Saving plots to pdf files using matplotlib

I want to save more than 1 plot to a pdf file. Here is my code: import matplotlib.pyplot as plt from matplotlib.backends.backend_pdf import PdfPages def function_plot(X,Y): plt.figure() plt.clf() pp = PdfPages('test.pdf') graph =…
aloha
  • 4,554
  • 6
  • 32
  • 40
13
votes
5 answers

is it possible to append figures to Matplotlib's PdfPages?

I want to save 2 figures created at different parts of a script into a PDF using PdfPages, is it possible to append them to the pdf? Example: fig = plt.figure() ax = fig_zoom.add_subplot(111) ax.plot(range(10), range(10), 'b') with…
Prashanth
  • 1,252
  • 2
  • 13
  • 28
11
votes
1 answer

Add text with PdfPages - matplotlib

Following this example of the official documentation, I can create a pdf file with the plots that I want in different pages. But I would like to add some text to the page(not inside the plot) and I've tried in this way without success: with…
Joe
  • 12,057
  • 5
  • 39
  • 55
9
votes
2 answers

How to include a PDF as appendix into a latex document with respect to the original page orientations?

I am using the pdfpages package to include a PDF document as appendix into my main latex document as follows: \usepackage{pdfpages} \includepdf[pages=-]{myfile.pdf} In general, this approach works but I have the following issues: The page…
Jonas
  • 2,974
  • 4
  • 24
  • 23
8
votes
1 answer

How to create a title page for a PDF document created using matplotlib

I have a report to be submitted automatically and I am using matplotlib to do that. But I am not able to figure out how to create a blank page in the begining with Title in the middle on the type of analysis which is performed with…
Bharath Kumar
  • 197
  • 2
  • 11
4
votes
1 answer

Error when saving multiple figures to a one multi-page PDF document

I'm trying to save several figures to one multi-page PDF document. My code is as follows: import matplotlib.backends.backend_pdf pdf = matplotlib.backends.backend_pdf.PdfPages('output.pdf') sns.set_style('darkgrid') g = sns.factorplot(data=df, …
equanimity
  • 2,371
  • 3
  • 29
  • 53
3
votes
0 answers

Memory is running full when using matplotlib.pyplot in a loop

I want to create a PDF file with data plots from many channels, using PdfPages. It works, but with large files it fills the memory until the program crashes. I found out, when I add an extra for loop, which creates additional subplots, the memory…
Frank H.
  • 31
  • 3
3
votes
0 answers

PDFPages package will not load in PDFLatex

I'm trying to include a PDF using \usepackage{pdfpages} but the package will not load. I'm getting the following error: LaTeX Warning: You have requested release `2020-10-01' of LaTeX, but only release `2020-02-02' is available. !…
Gracias
  • 45
  • 1
  • 2
  • 6
3
votes
0 answers

pdf savefig gives 'no figure none' value error, but works in lines above

I was using this code earlier to make some plots, but for some reason, the code is throwing me an error. I thought I had made a typo but that does not seem to be the case. #%% import random import pandas as pd import matplotlib.pyplot as…
Moo10000
  • 115
  • 11
3
votes
1 answer

pdfpages generating errors on newest version

I tried recompiling my bachelor thesis in latex today and encountered problems with the pdfpages package. While it worked perfectly when I originally compiled the thesis it now throws "undefined control sequence" errors. The new pdfpages package is…
MatthiasS
  • 69
  • 1
  • 5
3
votes
1 answer

how to stop pyplot from popping up figures

I write a number of plots to a pdf with a loop like the following. It works but there are two very annoying issues, 1) When the loop runs, i see a lot of windows ('Figure 1') popped up. I think the command plt.close(fig) does not work as intended.…
horaceT
  • 621
  • 13
  • 26
3
votes
1 answer

matplotlib PdfPages - storing a lossy copy of a plot with lots of data

I'm creating plots with matplotlib.pyplot and writing them to pdf. Some of these plots have largeish (up to 100,000) points and obviously have a lot of overlapping points, i.e. certain parts of the chart are just a solid mass. (That's okay - I'm…
unsorted
  • 3,114
  • 3
  • 29
  • 39
2
votes
1 answer

Highlight dataframe having NaN (matplotlib) while writing to the PDF file(PdfPages)?

I'm trying to perform two things: Highlight 'NaN' values with red color for the dataframe. Add the dataframe to the PDF file. I'm able to display the dataframe successfully in the PDF pages, however NaN values are not reflected with the red color…
Mandar Pande
  • 12,250
  • 16
  • 45
  • 72
2
votes
1 answer

How to create groups of different plots based on column dtype

I have a dataframe import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import matplotlib.patches as mpatches from matplotlib.backends.backend_pdf import PdfPages import numpy as np df= { …
nasa313
  • 266
  • 2
  • 12
2
votes
0 answers

matplotlib + pandas - PdfPages not generating PDFs

What I'm trying to do is build a python script that plots letter-grade distributions by class, and emails each instructor with a PDF of the distributions for all of their classes. The email part of the script works fine, as does the generation of…
morningstar2651
  • 179
  • 1
  • 6
1
2 3 4