python-3.x - 将 Python 代码图转换为 Dash 和 Plotly 图
问题描述
我有这个代码:
fig, axes = plt.subplots(nrows=1, ncols=3, figsize=(14, 8))
for xcol, ax in zip(dff.columns.values, axes):
dff.plot(kind='scatter', x=xcol, y=selected_dropdown_value, ax=ax, alpha=0.5,
color='r')
我需要将其转换为 Plotly 和 Dash 可以使用的东西,如本例所示:https ://plot.ly/pandas/line-and-scatter/ 。我怎样才能做到这一点?数据框是根据用户在下拉列表中选择的值创建的,然后根据 col_to_plot.. 列绘制所有列。
更新:数据如下:
country year type color col_to_plot_1 col_to_plot_2 ...
France 1991 t1 blue 200 3.5
Belgium 1992 t2 black 30 100.5
... ... .. ... ... ...
解决方案
推荐阅读
- haproxy - 如何使用与 req.hdr() 连接的变量的 set-header
- php - 改进具有变体的 Woocommerce 产品的 WC_Product_Query
- c# - 使用 NUnit 和继承的 asp.net 类进行单元测试时遇到问题
- angularjs - 将参数化的 md-date-locale 属性传递给 Angular JS 中的 md-datepicker
- linux - 发现 printf 无法打印换行符或回车
- python - 如何为本地和 docker 应用程序定义相同的 MongoClient?
- php - fullcalendar refresh #calendar 插入数据后
- python - Python优化:如何加快矩阵逆运算?
- multithreading - 使用 Negamax + alpha-beta 剪枝和转置表进行多线程评估
- spring - Spring 中的 @EnableWebMvc 是什么