Created
November 6, 2020 22:04
-
-
Save brinnaebent/9a2f99561e1c193ba22bd42febb7c06e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def plot_map_gif(year): | |
filterdata = data[data.year == year] | |
df = pd.DataFrame() | |
df['lat'] = pd.to_numeric(filterdata['latitude'], errors='coerce') | |
df['long'] = pd.to_numeric(filterdata['longitude '], errors='coerce') | |
df = df.dropna() | |
fig = plt.figure(figsize=(20,10)) | |
plt.rcParams.update({'font.size': 20}) | |
wmap = Basemap(projection='mill', llcrnrlat = -90, urcrnrlat = 90, llcrnrlon = -180, urcrnrlon = 180, resolution='c') | |
wmap.drawcoastlines() | |
latarray = np.array(df['lat']) | |
longarray = np.array(df['long']) | |
wmap.scatter(longarray, latarray, latlon=True, color='lime', s=20) | |
plt.title(('Reported UFO Sightings: ' + str(year))) # Add year to title here |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment