Skip to content

Instantly share code, notes, and snippets.

@alinazhanguwo
Created December 24, 2020 03:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alinazhanguwo/a8c19c7c440d38d83431f64c90e9f02d to your computer and use it in GitHub Desktop.
Save alinazhanguwo/a8c19c7c440d38d83431f64c90e9f02d to your computer and use it in GitHub Desktop.
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