pdfpages

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

人走茶凉 提交于 2020-01-09 11:09:28
问题 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 PdfPages(pdffilepath) as pdf: pdf.savefig(fig) fig1 = plt.figure() ax = fig_zoom.add_subplot(111) ax.plot(range(10), range(2, 12), 'r') with PdfPages(pdffilepath) as pdf: pdf.savefig(fig1) 回答1: Sorry, that's a lame question. We just shouldn't use the with statement

pdfpages generating errors on newest version

ε祈祈猫儿з 提交于 2019-12-11 05:26:17
问题 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 "packaged on 24/09/2019". Miktex console version is 2.9.7206 I tried compiling it with an old version I still had on my desktop pc which worked without a problem. After updating the miktex packages it stopped working there as well. I also produced

Saving plots to pdf files using matplotlib

不打扰是莪最后的温柔 提交于 2019-11-30 13:15:51
问题 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 = plt.title('y vs x') plt.xlabel('x axis', fontsize = 13) plt.ylabel('y axis', fontsize = 13) pp.savefig(graph) function_plot(x1,y1) function_plot(x2,y2) I know that my ideas are scrambled but I can't find the way to write my code. The thing is that I need my graphs to

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

五迷三道 提交于 2019-11-29 10:49:37
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 PdfPages(pdffilepath) as pdf: pdf.savefig(fig) fig1 = plt.figure() ax = fig_zoom.add_subplot(111) ax.plot(range(10), range(2, 12), 'r') with PdfPages(pdffilepath) as pdf: pdf.savefig(fig1) Sorry, that's a lame question. We just shouldn't use the with statement. fig = plt.figure() ax = fig_zoom.add_subplot(111) ax.plot(range(10), range(10), 'b') # create a PdfPages