小编Lam*_*ine的帖子

使用 Flask 显示 matplotlib 图

我想在我的 Flask Web 项目中可视化绘图 (SciView)。

这是我的代码:

import matplotlib.pyplot as plt 
# x-coordinates of left sides of bars 
left = [1, 2, 3, 4, 5] 
# heights of bars 
height = [10, 24, 36, 40, 5] 
# labels for bars 
tick_label = ['one', 'two', 'three', 'four', 'five'] 
# plotting a bar chart 
plt.bar(left, height, tick_label=tick_label, width=0.8, color=['red', 'green']) 
# naming the y-axis 
plt.xlabel('y - axis') 
# naming the x-axis 
plt.xlabel('x - axis') 
# plot title 
plt.title('My bar chart!') 
# function to …
Run Code Online (Sandbox Code Playgroud)

python matplotlib flask python-3.x

4
推荐指数
1
解决办法
5125
查看次数

标签 统计

flask ×1

matplotlib ×1

python ×1

python-3.x ×1