title: Combine sympy and matplotlib plots in one picture
body: <p>I need to build an expression graph and a graph set by an array of points, and return the images. To build an expression graph, I use <code>sympy.plot</code>, and to build a graph on points I use <code>matplotlib</code>.</p>
  
  <p>Here is an example code:</p>
  
  <pre><code>from os import remove
  from matplotlib import pyplot as plt
  from PIL import Image
  from sympy import plot, symbols
  
  def plot_graphic(x, y, expression, file_name):
      file = '{}.png'.format(file_name)
      x1, y1 = list(x), list(y)
      plt.plot(x1, y1)
      plt.savefig(file)
      plt.close()
      del y1
      img = Image.open(file)
      remove(file)
      yield img
  
      x = symbols('x')
      plot(expression.args[1], (x, x1[0], x1[-1]), show=False).save(file)
      img = Image.open(file)
      remove(file)
      yield img
  </code></pre>
  
  <p>x, y are generators. How can I combine these images at one?</p>