title: Jupyter notebook matplotlib figures missing in exported pdf
body: <p>When generating a pdf in jupyter notebook, everything works great, but I would like to keep the inline figures inside the pdf, as well as the notebook.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>%matplotlib notebook
  import matplotlib.pyplot as plt
  import numpy as np
  from IPython.display import set_matplotlib_formats
  set_matplotlib_formats('png', 'pdf')
  
  save_figures = True
  
  x = np.arange(0, 20, 0.1)
  y = np.sin(x)
  plt.figure()
  plt.plot(x, y)
  if save_figures:
      plt.savefig('test.png')
  plt.show()
  </code></pre>
  
  <p>The figures appear inline, but in the pdf what is printed instead is:</p>
  
  <pre><code>&lt;IPython.core.display.Javascript object&gt;
  
  &lt;IPython.core.display.HTML object&gt;
  </code></pre>
  
  <p>The same thing appears in the pdf if I export from the web or use <code>nbconvert</code> to export to pdf from the command line.</p>
  
  <p>Are there any additional commands that I need to invoke in order to get this to work? </p>