我使用plotly库创建图像并尝试以HTML显示。我以HTML格式格式化图像。但display(HTML(report_html))
代码不显示HTML页面。Plotly Ipython - 显示(HTML)函数不显示html文件
我正在使用python 3.5和pycharm IDE。我没有使用iPython笔记本。
的源代码:
from IPython.display import display, HTML, Image
import plotly.plotly as py
from plotly.offline import init_notebook_mode
init_notebook_mode()
data = go.scatter(x=df['date'], y=i, name = long_name['value'])
figures = [data]
images = [base64.b64encode(py.image.get(figure, width=width,height=height)).decode('utf-8') for figure in figures]
report_html = ''
for image in images:
_ = template
_ = _.format(image=image, caption='', width=width, height=height)
report_html += _
display(HTML(report_html))
我没有得到任何错误。我刚开以下输出
IPython.core.display.HTML对象
您使用plotl y离线绘制图像,还是使用情节性在线模式,您能澄清一下吗? –
我正在使用情节式在线模式。在公共云中保存密谋图表。 –
我不是专业的用户,我可以在网上积极使用吗? –