【发布时间】:2020-11-05 19:06:10
【问题描述】:
我有一个存储在 html 文件 file.html 中的绘图图。这是在另一个脚本中创建的,例如:
import plotly.graph_objects as go
fig = go.Figure(data=go.Bar(y=[2, 3, 1]))
fig.write_html('file.html', auto_open=True)
有没有办法直接打开html 文件而不重写情节代码?
比如:
fig = go.read_html('file.html')
我需要变量内的绘图。例如,这必须工作:
fig = read html file file.html
fig.write_html('copyOfFile.html', auto_open=True)
我同时使用 Python 和 R,所以我想要两者/其中之一的解决方案。
【问题讨论】:
标签: python r plotly r-plotly plotly-python