Created
December 24, 2020 03:51
-
-
Save alinazhanguwo/a8c19c7c440d38d83431f64c90e9f02d to your computer and use it in GitHub Desktop.
This file contains 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
import plotly.graph_objects as go | |
fig = go.Figure(data=go.Scattergeo( | |
lat = df['latitude'], | |
lon = df['longitude'], | |
text = df['_id'], | |
marker = dict( | |
size = 8, | |
opacity = 0.7, | |
reversescale = True, | |
autocolorscale = False, | |
symbol = 'square', | |
line = dict( | |
width=1, | |
color='rgba(226, 106, 106, 1)' | |
), | |
color='rgba(207, 0, 15, 1)', | |
) | |
)) | |
fig.update_layout( | |
geo = dict( | |
scope = 'north america', | |
showland = True, | |
landcolor = "rgb(212, 212, 212)", | |
subunitcolor = "rgb(255, 255, 255)", | |
countrycolor = "rgb(255, 255, 255)", | |
showlakes = True, | |
lakecolor = "rgb(255, 255, 255)", | |
showsubunits = True, | |
showcountries = True, | |
resolution = 50, | |
projection = dict( | |
type = 'conic conformal', | |
rotation_lon = -100 | |
), | |
lonaxis = dict( | |
showgrid = True, | |
gridwidth = 0.5, | |
range= [ -140.0, -50.0 ], | |
dtick = 5 | |
), | |
lataxis = dict ( | |
showgrid = True, | |
gridwidth = 0.5, | |
range= [ 35.0, 75.0 ], | |
dtick = 5 | |
) | |
), | |
title='Tim Hortons in North America', | |
) | |
fig.show() | |
fig.write_image("./TimHortonsInNorthAmerica.png", width=2400, height=1600) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment