title: Matplotlib/Pandas: How to plot multiple scatterplots within different locations in the same plot?
body: <p>I often have two pandas dataframes, which I would like to plot within the same plot. Normally these are two samples, and I would like to contrast their properties, as an example: </p>
  
  <p><a href="https://i.stack.imgur.com/IlOrO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IlOrO.png" alt="enter image description here"></a></p>
  
  <p>The x axis simply has two locations, the left for the first dataset, and the right for the second dataset. </p>
  
  <p>In matplotlib, one can plot multiple datasets within the same plot:</p>
  
  <pre><code>import matplotlib.pyplot as plt
  
  x = range(100)
  y = range(100,200)
  fig = plt.figure()
  ax1 = fig.add_subplot(111)
  
  ax1.scatter(x[:4], y[:4], s=10, c='b', marker="s", label='first')
  ax1.scatter(x[40:],y[40:], s=10, c='r', marker="o", label='second')
  plt.show()
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/pGmmI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pGmmI.png" alt="enter image description here"></a></p>
  
  <p>However, </p>
  
  <p>(1) How do you separate your datasets into two compartmentalized locations like the first example? </p>
  
  <p>(2) How do you accomplish this with two pandas dataframes? Do you merge them and then specify two locations for plotting? </p>