Last active
July 10, 2017 12:55
-
-
Save saliksyed/2f2a867e94e85d97c7c1e763b200f62e 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
from mpl_toolkits.basemap import Basemap | |
import matplotlib.pyplot as plt | |
# create new figure, axes instances. | |
# we specify specific sizes for the figure to make it bigger | |
# DPI is "Dots per inch" -- it's used in the printing world | |
# The reason we specify the DPI instead of raw pixels is because | |
# we want the text to be consistently scaled. | |
my_dpi = 75 | |
fig = plt.figure(figsize=(3600/my_dpi, 1800/my_dpi), dpi=my_dpi) | |
m = Basemap() | |
m.drawcoastlines() | |
# Load data from the JSON file and fill these in: | |
latitudes = [0, -10, 40, -20] | |
longitudes = [0, -10, 40, -20] | |
# add scatter points to the graph: | |
m.scatter(longitudes, latitudes, latlon=True, marker='D',color='m') | |
plt.savefig('map.png') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment