title: Is there a way to stretch the png image to fit the scatter plot?
body: <p>I need to understand a way to make the map fit the scatter plot points</p>
  
  <p>I've looked for solutions and have found <a href="https://stackoverflow.com/questions/18873623/matplotlib-and-apect-ratio-of-geographical-data-plots">matplotlib and apect ratio of geographical-data plots</a> to be somewhat helpful, but I still do not understand longitude and latitude and how to work with them in matplotlib. I've tried changing the aspect to 'equal' and it only makes a small difference in the points. My theory at the moment is I need to figure out how to find the correct aspect ratio by doing some math to make the image fit the points, but I'm not sure what to calculate. </p>
  
  <p><a href="https://i.stack.imgur.com/Gxo3q.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Gxo3q.png" alt="enter image description here"></a></p>
  
  <p>is what it currently looks like, and you can see the general shape of the US from the eastern points. How would I go about this problem? Any references or sources where I can learn more about this would be awesome. </p>
  
  <pre><code>coordinatelist = [list of longitude and latitude coordinates]
  #order of coordinates =&gt; [longitude min, longitude max, latitude min, latitude max]
  coords = [-160.2, -65.5, 14.5, 65.7]
  img= plt.imread(path)
  
  width = 636 #width of image in pixels
  height = 485 #height of image in pixels 
  
  fig, axes = plt.subplots(figsize = (10,9))
  axes.scatter(coordinatelist.longitude, coordinatelist.latitude, zorder=1, alpha= 0.4, c='r', s=8)
  axes.set_xlim(coords[0],coords[1])
  axes.set_ylim(coords[2],coords[3])
  axes.imshow(img, zorder=0, extent = coords, aspect = 'auto')
  
  plt.show()
  </code></pre>
  
  <p>I would like the points to match the background image, and if possible an explanation of how to reproduce the results so I can gain a deeper understanding. Thank you!</p>