【发布时间】:2021-07-11 19:36:52
【问题描述】:
我正在尝试使用 Dash 显示 Ploty 等值线地图。我尝试在 anaconda 提示符中使用 conda update --all 和 conda update dash 更新 Dash 和 Plotly,但这并没有解决问题。下面是代码为fig.show() 代码和 Dash 代码生成的图像的链接。
虚线绘图不起作用:
下面是代码:
external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']
app = dash.Dash(__name__, external_stylesheets=external_stylesheets)
fig = px.choropleth(dt_rwly_stn, geojson=smh, color="ConfirmedCovidCases",
locations="CountyName", featureidkey="properties.CountyName",
projection="mercator",
color_continuous_scale= 'Reds',
)
fig.update_geos(fitbounds="locations", visible=False)
fig.update_layout(margin={"r":0,"t":0,"l":0,"b":0})
fig.show()
app.layout = html.Div(children=[
html.H1(children='My First Dash'),
html.Div(children='''
Dash: A web application framework for Python.
'''),
dcc.Graph(
id='example-graph1',
figure=fig
),
])
if __name__ == '__main__':
app.run_server(debug=True, use_reloader=False)
谁能帮助我使用 Dash 正确显示 Plotly 图形?
【问题讨论】:
标签: python plotly plotly-dash