2.1.9.1.Choropleth Maps - USA
1. 使用library
import plotly.plotly as py
import plotly.graph_objs as go
from plotly.offline import download_plotlyjs,init_notebook_mode,plot,iplot
init_notebook_mode(connected = True)2.基本操作
data = dict(type = 'choropleth', locations = ['AZ', 'CA', 'NY'], locationmode = 'USA-states', colorscale = 'Portland', text = ['Arizona', 'Cali', 'New York'], z = [1.0 , 2.0, 3.0], colorbar = {'title': 'colorbar title goes here'})
layout = dict(geo={'scope': 'usa'})

3.從實際資料中繪製Choropleth Map

Previous2.1.9. Python for Data Visualization - Geographical plottingNext2.1.9.2.Choropleth Maps - World
Last updated
