title: Python, Multiple plots into one PDF page
body: <p>I have four nice charts that I can save as a PDF file but on 4 pages instead of only 2. I have a  2 charts with financial data of the company and another 2 charts with the prices of stock. I would like to have a one page in PDF with financial date of one company and price of stock. Of course, on the second page I need the same result but for the next company.</p>
  
  <p>Below is my code</p>
  
  <pre><code>with PdfPages('multipage_pdf.pdf') as pdf:
  
      fig1, ax = plt.subplots()
      index = np.arange(n_groups)
      bar_width = 0.35
      opacity = 0.8
  
      rects1 = plt.bar(index, z, bar_width,
                   alpha=opacity,
                   color='b',
                   label='Zysk_(strata)_netto')
  
      rects2 = plt.bar(index + bar_width, v, bar_width,
                   alpha=opacity,
                   color='g',
                   label='Zysk_(strata)_działal_oper')
  
      rects3 = plt.bar(index + bar_width + bar_width, b, bar_width,
                   alpha=opacity,
                   color='y',
                   label='EBITDA')
  
      plt.xlabel('Kwartaly')
      plt.ylabel('PLN')
      plt.title(companys_to_chart[0])
      plt.xticks(index + bar_width, x)
      plt.legend()
      ax.grid(True)
  
      plt.tight_layout()
      pdf.savefig()
      plt.close()
  
      x = company['Date']
      y = company['Close']
  
      x1 = WIG['Date']
      y1 = WIG['Close']
  
      fig2, ax = plt.subplots()
      ax.plot(x,y,label='Price')
      ax.set_ylabel("PLN")
      ax.set_xlabel("Date")
  
  
      ax2 = ax.twinx()
      ax2.plot(x1,y1, 'y-', label='WIG')
  
      myFmt = DateFormatter("%d-%m-%y")
      ax.xaxis.set_major_formatter(myFmt)
  
      fig2.autofmt_xdate()
  
      plt.ylabel('Points',size=10)
      plt.title(name_of_company)
      ax.grid(True)
  
      fig2.legend(bbox_to_anchor=(0.85, 0.35))
  
      pdf.savefig()
      plt.close()
  
  ##############################################################################
      x_1 = company_2['Kwartal']
      z_1 = company_2['Zysk_(strata)_netto']
      v_1 = company_2['Zysk_(strata)_działal_oper']
      b_1 = company_2['EBITDA']
  
      fig, ax = plt.subplots()
      index = np.arange(n_groups)
      bar_width = 0.35
      opacity = 0.8
  
      rects1 = plt.bar(index, z_1, bar_width,
                   alpha=opacity,
                   color='b',
                   label='Zysk_(strata)_netto')
  
      rects2 = plt.bar(index + bar_width, v_1, bar_width,
                   alpha=opacity,
                   color='g',
                   label='Zysk_(strata)_działal_oper')
  
      rects3 = plt.bar(index + bar_width + bar_width, b_1, bar_width,
                   alpha=opacity,
                   color='y',
                   label='EBITDA')
  
      plt.xlabel('Kwartaly')
      plt.ylabel('PLN')
      plt.title(companys_to_chart[1])
      plt.xticks(index + bar_width, x)
      plt.legend()
      ax.grid(True)
  
      plt.tight_layout()
  
      pdf.savefig()
      plt.close()
  
      x = company['Date']
      y = company['Close']
  
      x1 = WIG['Date']
      y1 = WIG['Close']
  
      fig, ax = plt.subplots()
      ax.plot(x,y,label='Price')
      ax.set_ylabel("PLN")
      ax.set_xlabel("Date")
  
  
      ax2 = ax.twinx()
      ax2.plot(x1,y1, 'y-', label='WIG')
  
      myFmt = DateFormatter("%d-%m-%y")
      ax.xaxis.set_major_formatter(myFmt)
  
      fig.autofmt_xdate()
  
      plt.ylabel('Points',size=10)
      plt.title(name_of_company_1)
      ax.grid(True)
  
      fig.legend(bbox_to_anchor=(0.85, 0.35))
  
      pdf.savefig()
      plt.close()
  </code></pre>
  
  <p>In the end I have a 4 pages instead of 2 and I am looking for result like below in PDF.
  <a href="https://i.stack.imgur.com/P99v8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/P99v8.png" alt="enter image description here"></a></p>
  
  <p>I hope that my question is clear :) Thanks for all help !</p>