我正在尝试使用 choropleth 绘制地图,但它给了我一个错误,说“color_dicrete_map”是一个意外的关键字。有人可以帮我吗?
def plot_vaccin(color, vaccin):
fig = px.choropleth(country_latest, locations="iso_code",
color=vaccin,
hover_name="country",
color_discrete_map={True: color, False: 'lightgrey'})
layout = go.Layout(
title=go.layout.Title(
text= f"<b>Countries using {vaccin} vaccin</b>",
x=0.5
),
showlegend=False,
font=dict(size=14),
width = 750,
height = 350,
margin=dict(l=0,r=0,b=0,t=30)
)
fig.update_layout(layout)
fig.show()