我是plotly和dash的新手,遇到了几个问题:
我收到了以下消息:
- 环境: 生产环境
- 警告:不要在生产环境中使用开发服务器。请使用生产WSGI服务器。
- 调试模式:关闭
此外,除非我重新启动计算机或更改app.run_server()中的端口,否则网页会显示原始图形,而不是我插入的Web结果。 这是我的代码:
import dash
import dash_core_components as dcc
import dash_html_components as html
import plotly.graph_objs as go
import numpy as np
app = dash.Dash()
np.random.seed(42)
random_x = np.random.randint(1,101,100)
random_y = np.random.randint(1,101,100)
app.layout = html.Div([
dcc.Graph(
id='scatter3',
figure={
'data': [
go.Scatter(
x = random_x,
y = random_y,
mode = 'markers',
marker = {
'size': 12,
'color': 'rgb(51,204,153)',
'symbol': 'pentagon',
'line': {'width': 2}
}
)
],
'layout': go.Layout(
title = 'Random Data Scatterplot',
xaxis = {'title': 'Some random x-values'},
yaxis = {'title': 'Some random y-values'},
hovermode='closest'
)
}
)
])
if __name__ == '__main__':
app.run_server()