I am using the
plotly.graph_objects
to map my data in Canda map. And, I am creating the fig as follows:
fig = go.Figure(data=go.Choropleth(
locations=df['state Abv'],
z=df['total applications'].astype(float),
locationmode='**UNKNOWN**',
colorscale='Reds',
autocolorscale=False,
text=df['text'],
marker_line_color='white',
colorbar_title="Number of applications"))
Is there a way to set locattionmode as "Canada" to map the data on Canada map?
Thank you!
Ben
You can use folium library to map countries easily.
For example to map a country, just write coordinates of that place in location parameter:(I have plotted for India)
And to add a popup and other features to it you can do:(I have added this popup for a place called onatrio.)
This code is not for jupyter. If you are using jupyter then cut the last part of IPython libray from this code. I hope you got my instructions.
Happy coding!