I am trying to plot some longitudal and latitudal coordinates on a map with basemap
. The code I am running is:
m = Basemap(projection='merc', resolution='i',
llcrnrlat=min_lat - 3, urcrnrlat=max_lat + 3,
llcrnrlon=min_long - 3, urcrnrlon=max_long + 3)
m.drawcoastlines()
m.fillcontinents(color="#FFDDCC", lake_color='#DDEEFF')
m.drawmapboundary(fill_color='#DDEEFF')
m.drawcountries(linewidth=1)
for coordinates in locations:
m.scatter(coordinates[1], coordinates[0], marker='D', color='m')
plt.show()
where:
min_lat, min_long, max_lat, max_long = 48.9810946, -0.014840257753543178, 60.448137, 24.9362469
and the coordinates in this setup, i.e. locations
(that is plotted via the for loop
) are these six:
[55.663457, 12.34772]
[53.5797869, 10.0131747]
[53.549816899999996, 10.048393278279384]
[52.3353336, 4.9294416]
[51.5118813, -0.0010296]
[51.5118813, -0.0010296]
The result is:
and as you may be able to see there are some purple in the lower-left corner, which I'm guessing is all the points wrapped up in the same point.
I have tried to make the map bigger, but that results in the same, and I also tried to switch between m.scatter(coordinates[1], coordinates[0], marker='D', color='m')
and m.scatter(coordinates[0], coordinates[1], marker='D', color='m')
with the same result.
What am I doing wrong here? (and yes, this is my first time with basemap
, so bear with me).
question from:
https://stackoverflow.com/questions/65888432/coordinates-on-basemap-seems-to-be-at-0-0