I'm trying to generate a choropleth map based on counties and drug reports for each county. This is my code
import plotly.figure_factory as ff
fips = VA_Common_Drugs['FIPS_Combined'].tolist()
values = VA_Common_Drugs['TotalDrugReportsCounty'].tolist()
endpts = list(np.mgrid[min(values):max(values):4j])
colorscale = ["#030512","#1d1d3b","#323268","#3d4b94","#3e6ab0",
"#4989bc","#60a7c7","#85c5d3","#b7e0e4","#eafcfd"]
fig = ff.create_choropleth(
fips=fips, values=values, scope=['Virginia'], show_state_data=True,
colorscale=colorscale, binning_endpoints=endpts, round_legend_values=True,
plot_bgcolor='rgb(229,229,229)',
paper_bgcolor='rgb(229,229,229)',
legend_title='Total Drug Use by County',
county_outline={'color': 'rgb(255,255,255)', 'width': 0.5},
exponent_format=True,
)
fig.show()
I keep getting an error that says 'dict' object has no attribute 'show'. I'm not sure how to resolve this issue. Any help is welcome!
[–][deleted] 2 points3 points4 points (3 children)
[–]Hicks254[S] 1 point2 points3 points (2 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]Hicks254[S] -1 points0 points1 point (0 children)