Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created May 18, 2021 08:12
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 amankharwal/4fd16775c8f50126cdeb4ea95143bc5c to your computer and use it in GitHub Desktop.
Save amankharwal/4fd16775c8f50126cdeb4ea95143bc5c to your computer and use it in GitHub Desktop.
# Choropleth Maps
import plotly.graph_objects as go
import pandas as pd
data = pd.read_csv("https://raw.githubusercontent.com/amankharwal/Website-data/master/usa.csv")
figure = go.Figure(data=go.Choropleth(locations=data["code"],
z = data["total exports"].astype(float),
locationmode="USA-states",
colorscale="Reds",
colorbar_title="Millions USD"))
figure.update_layout(title_text="US Agriculture Exports", geo_scope='usa')
figure.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment