I am using python matplotliband libraries Basemap.
I am trying to make a list of GPS points around the city of Chicago for a project that I am working on, but it is not working. I looked through all the available examples, but despite copying and pasting them verbatim (and then changing the gps points), the map cannot be displayed with the dots plotted.
Here are some examples as they are stored in my code:
[(41.98302392, -87.71849159),
(41.77351707, -87.59144826),
(41.77508317, -87.58899995),
(41.77511247, -87.58646695),
(41.77514645, -87.58515301),
(41.77538531, -87.58611272),
(41.71339537, -87.56963306),
(41.81685612, -87.59757281),
(41.81697313, -87.59910809),
(41.81695808, -87.60049861),
(41.75894604, -87.55560586)]
and here is the code that I use to display the map (which does not work).
from pymongo import *
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
from collections import Counter
import ast
def routes_map():
"""
doesn't work :(
# map of chicago
"""
all_locations = []
x = []
y = []
for loc in all_locations:
x.append(float(loc[0]))
y.append(float(loc[1]))
loc = [41.8709, -87.6331]
m = Basemap(llcrnrlon=-90.0378,llcrnrlat=40.6046,urcrnrlon=-85.4277,urcrnrlat=45.1394,
projection='merc',resolution='h')
m.drawcoastlines()
m.drawstates()
m.drawmapboundary(fill_color='white')
x1, y1 = m(x[:100],y[:100])
m.plot(x1,y1,marker="o",alpha=1.0)
plt.title("City of Chicago Bus Stops")
plt.show()
Here is what I get from running this code:

Does anyone have any tips on what I'm doing wrong?