title: How do I make a matplotlib scatter plot square?
body: <p>In gnuplot I can do this to get a square plot:</p>
  
  <pre><code>set size square
  </code></pre>
  
  <p>What is the equivalent in matplotlib? I have tried this:</p>
  
  <pre><code>import matplotlib
  matplotlib.use('Agg')
  import matplotlib.pyplot as plt
  plt.rcParams['backend'] = 'TkAgg'
  x = [0, 0.2, 0.4, 0.6, 0.8]
  y = [0, 0.5, 1, 1.5, 2.0]
  colors = ['k']*len(x)
  plt.scatter(x, y, c=colors, alpha=0.5)
  plt.axes().set_aspect('equal', adjustable='datalim')
  plt.xlim((0,2))
  plt.ylim((0,2))
  plt.grid(b=True, which='major', color='k', linestyle='--')
  plt.savefig('{}.png'.format(rsID), dpi=600)
  plt.close()
  plt.clf()
  </code></pre>
  
  <p>I get a square grid, but the plot itself is not square. How do I make the x range go from 0 to 2 and make the plot square?
  <img src="https://i.stack.imgur.com/efOMI.png" alt="enter image description here"></p>