title: Matplotlib scatterplot axis autoscale fails for small data values
body: <p>When using Matplotlib's <code>scatterplot</code>, sometimes autoscaling works, sometimes not.</p>
  
  <p>How do I fix it?</p>
  
  <p>As in the example provided in the bug report, this code works:</p>
  
  <pre><code>plt.figure()
  x = np.array([0,1,2,3])
  x = np.array([2,4,5,9])
  plt.scatter(x,y)
  </code></pre>
  
  <p>But when using smaller values, the scaling fails to work:</p>
  
  <pre><code>plt.figure()
  x = np.array([0,1,2,3])
  x = np.array([2,4,5,9])
  plt.scatter(x/10000,y/10000)
  </code></pre>
  
  <p>Edit: An example can be found <a href="https://github.com/matplotlib/matplotlib/issues/6015" rel="nofollow">here</a>. I have not specified the specific cause in the question, because when encountering the error it is not obvious what causes it. Also, I have specified the solution and cause in my own answer.</p>