I need to understand a way to make the map fit the scatter plot points
I've looked for solutions and have found matplotlib and apect ratio of geographical-data plots 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.
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.
coordinatelist = [list of longitude and latitude coordinates]
#order of coordinates => [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()
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!