用Python绘声绘色

2024-10-02 14:23:17 发布

您现在位置:Python中文网/ 问答频道 /正文

我的计划不能正常工作。我试图用html呈现图形,但它总是显示文本而不是图形本身。在

下面是用'应用程序副本'文件-使用烧瓶微框架。在

 k = plotly.offline.plot({
    "data": [go.Scatter(x = money_x, y = result, name = "Expenditure")],
    "layout": go.Layout(title="Expenditure")
}, auto_open=True, show_link=False, output_type = 'div', include_plotlyjs=False)
return render_template('plot.html', name=session['name'], surname=session['surname'], k=str(k), sun=session['student_number'])

下面是html文件的摘录。在html中,我包含了一个在线图形,以便尝试看看代码有什么问题——但这之后返回了无意义的结果。在

^{pr2}$

下面是观察到的程序输出的图片。正如人们所看到的,从网上得到的绘本图像没有受到伤害,而我生成的图形没有被翻译成情节丰富的内容。在

请帮忙

(据我所知,该项目已经包含了相关的Javascript) Image illustrating the output of the Flask microframework and the HTML file that were provided previously


Tags: 文件name文本false应用程序图形goplot